Class PreparedBatchStatement

java.lang.Object
org.dbunit.database.statement.AbstractPreparedBatchStatement
org.dbunit.database.statement.PreparedBatchStatement
All Implemented Interfaces:
IPreparedBatchStatement

public class PreparedBatchStatement extends AbstractPreparedBatchStatement
IPreparedBatchStatement that accumulates bound rows using the JDBC addBatch()/executeBatch() mechanism.
Since:
Mar 16, 2002
Version:
$Revision$
Author:
Manuel Laflamme
  • Method Details

    • addValue

      public void addValue(Object value, DataType dataType) throws TypeCastException, SQLException
      Description copied from interface: IPreparedBatchStatement
      Binds the given value, cast using the given data type, to the next parameter of the statement.
      Parameters:
      value - the value to bind.
      dataType - the data type used to cast the value.
      Throws:
      TypeCastException - if the value cannot be cast to the given data type.
      SQLException - if binding the value to the statement fails.
    • addBatch

      public void addBatch() throws SQLException
      Description copied from interface: IPreparedBatchStatement
      Adds the currently bound parameters as a new row to the batch.
      Throws:
      SQLException - if adding the batch row fails.
    • executeBatch

      public int executeBatch() throws SQLException
      Description copied from interface: IPreparedBatchStatement
      Executes all batched rows.
      Returns:
      the number of rows affected by each batched statement.
      Throws:
      SQLException - if executing the batch fails.
    • clearBatch

      public void clearBatch() throws SQLException
      Description copied from interface: IPreparedBatchStatement
      Clears all batched rows.
      Throws:
      SQLException - if clearing the batch fails.