Package org.dbunit.database.statement
Class BatchStatementDecorator
java.lang.Object
org.dbunit.database.statement.BatchStatementDecorator
- All Implemented Interfaces:
IPreparedBatchStatement
Decorator that adapts a plain
IBatchStatement to the IPreparedBatchStatement
interface by substituting bound values directly into the SQL text instead of using JDBC
bind parameters.- Since:
- Mar 16, 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
Description copied from interface:IPreparedBatchStatementBinds the given value, cast using the given data type, to the next parameter of the statement.- Specified by:
addValuein interfaceIPreparedBatchStatement- 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
Description copied from interface:IPreparedBatchStatementAdds the currently bound parameters as a new row to the batch.- Specified by:
addBatchin interfaceIPreparedBatchStatement- Throws:
SQLException- if adding the batch row fails.
-
executeBatch
Description copied from interface:IPreparedBatchStatementExecutes all batched rows.- Specified by:
executeBatchin interfaceIPreparedBatchStatement- Returns:
- the number of rows affected by each batched statement.
- Throws:
SQLException- if executing the batch fails.
-
clearBatch
Description copied from interface:IPreparedBatchStatementClears all batched rows.- Specified by:
clearBatchin interfaceIPreparedBatchStatement- Throws:
SQLException- if clearing the batch fails.
-
close
Description copied from interface:IPreparedBatchStatementCloses this statement.- Specified by:
closein interfaceIPreparedBatchStatement- Throws:
SQLException- if closing the statement fails.
-