Interface JdbcBatchStatementExecutor<T>
-
- All Known Implementing Classes:
InsertOrUpdateJdbcExecutor,TableBufferedStatementExecutor,TableBufferReducedStatementExecutor,TableInsertOrUpdateStatementExecutor,TableSimpleStatementExecutor
@Internal public interface JdbcBatchStatementExecutor<T>Executes the given JDBC statement in batch for the accumulated records.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddToBatch(T record)voidcloseStatements()Close JDBC related statements.voidexecuteBatch()Submits a batch of commands to the database for execution.static <T,K>
JdbcBatchStatementExecutor<T>keyed(String sql, java.util.function.Function<T,K> keyExtractor, JdbcStatementBuilder<K> statementBuilder)voidprepareStatements(Connection connection)Create statements from connection.static <T,V>
JdbcBatchStatementExecutor<T>simple(String sql, JdbcStatementBuilder<V> paramSetter, java.util.function.Function<T,V> valueTransformer)
-
-
-
Method Detail
-
prepareStatements
void prepareStatements(Connection connection) throws SQLException
Create statements from connection.- Throws:
SQLException
-
addToBatch
void addToBatch(T record) throws SQLException
- Throws:
SQLException
-
executeBatch
void executeBatch() throws SQLExceptionSubmits a batch of commands to the database for execution.- Throws:
SQLException
-
closeStatements
void closeStatements() throws SQLExceptionClose JDBC related statements.- Throws:
SQLException
-
keyed
static <T,K> JdbcBatchStatementExecutor<T> keyed(String sql, java.util.function.Function<T,K> keyExtractor, JdbcStatementBuilder<K> statementBuilder)
-
simple
static <T,V> JdbcBatchStatementExecutor<T> simple(String sql, JdbcStatementBuilder<V> paramSetter, java.util.function.Function<T,V> valueTransformer)
-
-