NIFI-6100 Use setBytes in JdbcCommon for binary types

This closes #3410

Signed-off-by: Mike Thomsen <mikerthomsen@gmail.com>
This commit is contained in:
Aaron Leon 2019-04-04 23:23:33 -05:00 committed by Mike Thomsen
parent 8245bc3f80
commit 81ddd02ca8

View File

@ -807,7 +807,11 @@ public class JdbcCommon {
throw new ParseException("Unable to parse binary data using the formatter `" + valueFormat + "`.",0);
}
stmt.setBinaryStream(parameterIndex, new ByteArrayInputStream(bValue), bValue.length);
try {
stmt.setBinaryStream(parameterIndex, new ByteArrayInputStream(bValue), bValue.length);
} catch (Exception ex) {
stmt.setBytes(parameterIndex, bValue);
}
break;
case Types.CHAR: