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
All Methods Instance Methods Concrete Methods 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 Detail
-
sql
private final String sql
-
statement
private final PreparedStatement statement
-
parameterTypes
private final int[] parameterTypes
-
count
private int count
-
-
Constructor Detail
-
UpdateBatcher
UpdateBatcher(Connection c, String sql, int... parameterTypes) throws SQLException
Prepare a new batcher for the given SQL statement.- Parameters:
sql
- A SQL statementparameterTypes
- Parameter type codes as defined inTypes
.- Throws:
SQLException
-
-
Method Detail
-
getSql
String getSql()
The SQL statement this batcher is executing.
-
addToBatch
void addToBatch(Object... values) throws SQLException
Add a new entry to the batch. The number of values must match the number of parameter types.- Throws:
SQLException
-
flush
void flush() throws SQLException
Flush and execute the statements added to the batch.- Throws:
SQLException
-
close
void close()
Close the batcher.
-
-