private void setArgumentsForPreparedStatement(PreparedStatement preparedStatement, Object[] arguments) throws SQLException{
    for (int i = 0; i < arguments.length; i++) {
      if (arguments[i] instanceof byte[]) {
        byte[] binaryData = (byte[]) arguments[i];

        // JDBC drivers supports only this function signature
        preparedStatement.setBinaryStream(i+1, new ByteArrayInputStream(binaryData), binaryData.length);
      } else {
        preparedStatement.setObject(i+1, arguments[i]);
      }
    }
  }
Setting arguments for prepared statement

@param preparedStatement {@link PreparedStatement} object
@param arguments array of arguments

@throws SQLException
ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java