code: protected int[] batch(StatementHandler stmtHandler, String sql, QueryParameters[] params) throws SQLException {
          Connection conn = this.transactionHandler.getConnection();
  
          if (sql == null) {
              this.transactionHandler.rollback();
              this.transactionHandler.closeConnection();
  
              throw new SQLException("Null SQL statement");
          }
  
          if (params == null) {
              this.transactionHandler.rollback();
              this.transactionHandler.closeConnection();
  
              throw new SQLException("Null parameters. If parameters aren't need, pass an empty array.");
          }
  
          PreparedStatement stmt = null;
          int[] rows = null;
          QueryParameters[] processedParams = new QueryParameters[params.length];
  
          try {
  
              stmt = this.prepareStatement(conn, null, sql, false);
  
              for (int i = 0; i < params.length; i++) {
                  processedParams[i] = typeHandler.processInput(stmt, params[i]);
  
                  stmtHandler.setStatement(stmt, processedParams[i]);
                  stmt.addBatch();
              }
              rows = stmt.executeBatch();
  
              for (int i = 0; i < params.length; i++) {
                  typeHandler.afterExecute(stmt, processedParams[i], params[i]);
              }
  
              if (this.isTransactionManualMode() == false) {
                  this.transactionHandler.commit();
              }
  
          } catch (SQLException e) {
              if (this.isTransactionManualMode() == false) {
                  this.transactionHandler.rollback();
              }
  
              rethrow(conn, e, sql, (Object[]) params);
          } finally {
  
              stmtHandler.beforeClose();
              MjdbcUtils.closeQuietly(stmt);
              stmtHandler.afterClose();
  
              this.transactionHandler.closeConnection();
          }
  
          return rows;
      }
docs: Execute a batch of SQL INSERT, UPDATE, or DELETE queries.
  
  @param stmtHandler {@link StatementHandler} implementation
  @param sql         The SQL query to execute.
  @param params      An array of query replacement parameters.  Each row in
  this array is one set of batch replacement values.
  @return array of row affected
  @throws SQLException if exception would be thrown by Driver/Database