MikeThomsen commented on a change in pull request #3410: NIFI-6100 Use setBytes 
in JdbcCommon for binary types
URL: https://github.com/apache/nifi/pull/3410#discussion_r286160733
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java
 ##########
 @@ -807,7 +807,7 @@ public static void setParameter(final PreparedStatement 
stmt, final String attrN
                             throw new ParseException("Unable to parse binary 
data using the formatter `" + valueFormat + "`.",0);
                     }
 
-                    stmt.setBinaryStream(parameterIndex, new 
ByteArrayInputStream(bValue), bValue.length);
+                    stmt.setBytes(parameterIndex, bValue);
 
 Review comment:
   @mattyb149 @patricker I'm not a fan of setting a flag because after skimming 
over that method I didn't see a good place to store a state to track whether 
the except was thrown in a previous pass. I'll add the try/catch and merge.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to