Package org.dbunit.database.statement
Interface IPreparedBatchStatement
- All Known Implementing Classes:
AbstractPreparedBatchStatement,AutomaticPreparedBatchStatement,BatchStatementDecorator,PreparedBatchStatement,SimplePreparedStatement
public interface IPreparedBatchStatement
A batched, parameterized JDBC statement to which typed column values are bound
before execution.
- Since:
- Mar 15, 2002
- Version:
- $Revision$
- Author:
- Manuel Laflamme
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatch()Adds the currently bound parameters as a new row to the batch.voidBinds the given value, cast using the given data type, to the next parameter of the statement.voidClears all batched rows.voidclose()Closes this statement.intExecutes all batched rows.
-
Method Details
-
addValue
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
Adds the currently bound parameters as a new row to the batch.- Throws:
SQLException- if adding the batch row fails.
-
executeBatch
Executes all batched rows.- Returns:
- the number of rows affected by each batched statement.
- Throws:
SQLException- if executing the batch fails.
-
clearBatch
Clears all batched rows.- Throws:
SQLException- if clearing the batch fails.
-
close
Closes this statement.- Throws:
SQLException- if closing the statement fails.
-