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, databaseFields inherited from interface liquibase.statement.SqlStatement
EMPTY_SQL_STATEMENT -
Constructor Summary
ConstructorsConstructorDescriptionBatchDmlExecutablePreparedStatement(Database database, String catalogName, String schemaName, String tableName, List<LoadDataColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor, List<ExecutablePreparedStatementBase> statements) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidattachParams(List<? extends ColumnConfig> ignored, PreparedStatement stmt) Sets the list of bind variables for the execution of a DML statementbooleanprotected voidprotected StringgenerateSql(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, toCharacterStreamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface liquibase.statement.SqlStatement
getFormattedStatement
-
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:ExecutablePreparedStatementBaseSets the list of bind variables for the execution of a DML statement- Overrides:
attachParamsin 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:
generateSqlin classExecutablePreparedStatementBase
-
executePreparedStatement
- Overrides:
executePreparedStatementin classExecutablePreparedStatementBase- Throws:
SQLException
-
continueOnError
public boolean continueOnError()
-