Package liquibase.statement
Class BatchDmlExecutablePreparedStatement
java.lang.Object
liquibase.statement.ExecutablePreparedStatementBase
liquibase.statement.BatchDmlExecutablePreparedStatement
- All Implemented Interfaces:
ExecutablePreparedStatement
,SqlStatement
Performance-optimised version of
ExecutablePreparedStatementBase
. JDBC batching collects several
executions of DML statements and waits until a certain number of commands has been collected. Then, it sends all
of them to the RDBMS in a single call. Statement.executeBatch()
saves many round-trips between
client and database, often speeding up bulk inserts/updates dramatically if the JDBC driver supports it.-
Nested Class Summary
Nested classes/interfaces inherited from class liquibase.statement.ExecutablePreparedStatementBase
ExecutablePreparedStatementBase.LOBContent<T>
-
Field Summary
Fields inherited from class liquibase.statement.ExecutablePreparedStatementBase
coreBundle, database
Fields inherited from interface liquibase.statement.SqlStatement
EMPTY_SQL_STATEMENT
-
Constructor Summary
ConstructorDescriptionBatchDmlExecutablePreparedStatement
(Database database, String catalogName, String schemaName, String tableName, List<LoadDataColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor, List<ExecutablePreparedStatementBase> statements) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
attachParams
(List<? extends ColumnConfig> ignored, PreparedStatement stmt) Sets the list of bind variables for the execution of a DML statementboolean
protected void
protected String
generateSql
(List<ColumnConfig> cols) Returns the individual statements that are currently store in this batch.Methods inherited from class liquibase.statement.ExecutablePreparedStatementBase
applyColumnParameter, applyVisitors, createStream, execute, getCachedStatement, getCatalogName, getChangeSet, getColumns, getContentLength, getContentLength, getResourceAccessor, getResourceAsStream, getSchemaName, getTableName, skipOnUnsupported, toBinaryStream, toCharacterStream
-
Constructor Details
-
BatchDmlExecutablePreparedStatement
public BatchDmlExecutablePreparedStatement(Database database, String catalogName, String schemaName, String tableName, List<LoadDataColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor, List<ExecutablePreparedStatementBase> statements)
-
-
Method Details
-
getIndividualStatements
Returns the individual statements that are currently store in this batch.- Returns:
- the List of the stored statements (may be empty if none are stored)
-
attachParams
protected void attachParams(List<? extends ColumnConfig> ignored, PreparedStatement stmt) throws SQLException, DatabaseException Description copied from class:ExecutablePreparedStatementBase
Sets the list of bind variables for the execution of a DML statement- Overrides:
attachParams
in classExecutablePreparedStatementBase
- Parameters:
ignored
- a list of columns with their designated valuesstmt
- the PreparedStatement to which the values are to be attached- Throws:
SQLException
- if JDBC objects to a setting (non-existent bind number, wrong column type etc.)DatabaseException
- if an I/O error occurs during the read of LOB values
-
generateSql
- Specified by:
generateSql
in classExecutablePreparedStatementBase
-
executePreparedStatement
- Overrides:
executePreparedStatement
in classExecutablePreparedStatementBase
- Throws:
SQLException
-
continueOnError
public boolean continueOnError()
-