code: public void setBytes(PreparedStatement statement, int pos, byte[] content) throws SQLException {
  
          if (content.length < 2000) {
              statement.setBytes(pos, content);
          } else {
              statement.setBinaryStream(pos, new ByteArrayInputStream(content), content.length);
          }
      }
docs: Sets the designated parameter to the given Java array of bytes.<p>
  
  The driver converts this to an SQL VARBINARY or LONGVARBINARY (depending on the argument's
  size relative to the driver's limits on VARBINARY values) when it sends it to the database.
  
  @param statement the PreparedStatement where the content is set
  @param pos the first parameter is 1, the second is 2, ...
  @param content the parameter value
  @throws SQLException if a database access error occurs