Package net.sf.basedb.core
Class AnnotationBatcher.UpdateBatcher
java.lang.Object
net.sf.basedb.core.AnnotationBatcher.UpdateBatcher
- Enclosing class:
- AnnotationBatcher
static class AnnotationBatcher.UpdateBatcher extends Object
Batcher implementation for updating and deleting from tables.
-
Field Summary
Fields Modifier and Type Field Description private int
count
private int[]
parameterTypes
private String
sql
private PreparedStatement
statement
-
Constructor Summary
Constructors Constructor Description UpdateBatcher(Connection c, String sql, int... parameterTypes)
Prepare a new batcher for the given SQL statement. -
Method Summary
Modifier and Type Method Description (package private) void
addToBatch(Object... values)
Add a new entry to the batch.(package private) void
close()
Close the batcher.(package private) void
flush()
Flush and execute the statements added to the batch.(package private) String
getSql()
The SQL statement this batcher is executing.
-
Field Details
-
sql
-
statement
-
parameterTypes
private final int[] parameterTypes -
count
private int count
-
-
Constructor Details
-
UpdateBatcher
Prepare a new batcher for the given SQL statement.- Parameters:
sql
- A SQL statementparameterTypes
- Parameter type codes as defined inTypes
.- Throws:
SQLException
-
-
Method Details
-
getSql
String getSql()The SQL statement this batcher is executing. -
addToBatch
Add a new entry to the batch. The number of values must match the number of parameter types.- Throws:
SQLException
-
flush
Flush and execute the statements added to the batch.- Throws:
SQLException
-
close
void close()Close the batcher.
-