mirror of https://github.com/apache/nifi.git
NIFI-7095: ResetSetRecordSet: handle java.sql.Array Types in normalizeValue method
Some jdbc drivers e.g. Oracle returns java.sql.Array objects for array types, not just Lists. This commit also handles these cases, and extracts the primitive java arrays out of this jdbc holder class. Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #4034.
This commit is contained in:
parent
dd6bcc7485
commit
98f9b7c033
|
@ -128,7 +128,7 @@ public class ResultSetRecordSet implements RecordSet, Closeable {
|
|||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private Object normalizeValue(final Object value) {
|
||||
private Object normalizeValue(final Object value) throws SQLException {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -137,6 +137,10 @@ public class ResultSetRecordSet implements RecordSet, Closeable {
|
|||
return ((List) value).toArray();
|
||||
}
|
||||
|
||||
if (value instanceof Array) {
|
||||
return ((Array) value).getArray();
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue