code: public int[] batch(Connection conn, String sql, Object[][] params, int[] paramTypes)
          throws SQLException {
  
          PreparedStatement stmt = null;
          int[] rows = null;
          try {
              stmt = this.prepareStatement(conn, sql);
  
              for (int i = 0; i < params.length; i++) {
                  this.fillStatement(stmt, params[i], paramTypes);
                  stmt.addBatch();
              }
              rows = stmt.executeBatch();
  
          } catch (SQLException e) {
              this.rethrow(e, sql, params);
          } finally {
              close(stmt);
          }
  
          return rows;
      }
docs: Execute a batch of SQL INSERT, UPDATE, or DELETE queries.
  
  @param conn The Connection to use to run the query.  The caller is
  responsible for closing this Connection.
  @param sql The SQL to execute.
  @param params An array of query replacement parameters.  Each row in
  this array is one set of batch replacement values.
  @param paramTypes Query replacement parameters types; <code>null</code> is a valid
  value to pass in.
  @return The number of rows updated per statement.
  @throws java.sql.SQLException if a database access error occurs