Exemplo n.º 1
0
 /**
  * Adds a statement to a batch
  *
  * @param statementScope - the request scope
  * @param conn - the database connection
  * @param sql - the sql statement
  * @param parameters - the parameters for the statement
  * @throws SQLException - if the statement fails
  */
 public void addBatch(
     StatementScope statementScope, Connection conn, String sql, Object[] parameters)
     throws SQLException {
   Batch batch = (Batch) statementScope.getSession().getBatch();
   if (batch == null) {
     batch = new Batch();
     statementScope.getSession().setBatch(batch);
   }
   batch.addBatch(statementScope, conn, sql, parameters);
 }