Top Description Fields Constructors Methods
liquibase.statement

public Class BatchDmlExecutablePreparedStatement

extends ExecutablePreparedStatementBase
Class Inheritance
Imports
liquibase.Scope, liquibase.change.ColumnConfig, liquibase.change.core.LoadDataColumnConfig, liquibase.changelog.ChangeSet, liquibase.database.Database, liquibase.exception.DatabaseException, liquibase.logging.Logger, liquibase.resource.ResourceAccessor, java.sql.PreparedStatement, .SQLException, java.util.ArrayList, .List

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. java.sql.Statement#executeBatch() saves many round-trips between client and database, often speeding up bulk inserts/updates dramatically if the JDBC driver supports it.
See Also
Blog entry on "Java Persistence Performance" about batching

Field Summary

Modifier and TypeField and Description
private final List<ExecutablePreparedStatementBase>
private final Logger
Inherited from liquibase.statement.ExecutablePreparedStatementBase:
coreBundledatabase

Constructor Summary

AccessConstructor and Description
public
BatchDmlExecutablePreparedStatement(Database database, String catalogName, String schemaName, String tableName, List<LoadDataColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor, List<ExecutablePreparedStatementBase> statements)

Method Summary

Modifier and TypeMethod and Description
protected void
attachParams(List<? extends ColumnConfig>
a list of columns with their designated values
ignored
,
PreparedStatement
the PreparedStatement to which the values are to be attached
stmt
)

Overrides liquibase.statement.ExecutablePreparedStatementBase.attachParams.

Sets the list of bind variables for the execution of a DML statement

public boolean
protected void
protected String
public List<ExecutablePreparedStatementBase>

Returns:

the List of the stored statements (may be empty if none are stored)
getIndividualStatements
()

Returns the individual statements that are currently store in this batch.

Inherited from liquibase.statement.ExecutablePreparedStatementBase:
applyColumnParameterapplyVisitorscreateStreamexecutegetCachedStatementgetCatalogNamegetChangeSetgetColumnsgetContentLengthgetContentLengthgetResourceAccessorgetResourceAsStreamgetSchemaNamegetTableNameskipOnUnsupportedtoBinaryStreamtoCharacterStream

Field Detail

collectedStatementsback to summary
private final List<ExecutablePreparedStatementBase> collectedStatements
LOGback to summary
private final Logger LOG

Constructor Detail

BatchDmlExecutablePreparedStatementback to summary
public BatchDmlExecutablePreparedStatement(Database database, String catalogName, String schemaName, String tableName, List<LoadDataColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor, List<ExecutablePreparedStatementBase> statements)

Method Detail

attachParamsback to summary
protected void attachParams(List<? extends ColumnConfig> ignored, PreparedStatement stmt) throws SQLException, DatabaseException

Overrides liquibase.statement.ExecutablePreparedStatementBase.attachParams.

Doc from liquibase.statement.ExecutablePreparedStatementBase.attachParams.

Sets the list of bind variables for the execution of a DML statement

Parameters
ignored:List<? extends ColumnConfig>

a list of columns with their designated values

stmt:PreparedStatement

the PreparedStatement to which the values are to be attached

Annotations
@Override
Exceptions
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
continueOnErrorback to summary
public boolean continueOnError()

Implements liquibase.statement.SqlStatement.continueOnError.

Annotations
@Override
executePreparedStatementback to summary
protected void executePreparedStatement(PreparedStatement stmt) throws SQLException

Overrides liquibase.statement.ExecutablePreparedStatementBase.executePreparedStatement.

Annotations
@Override
generateSqlback to summary
protected String generateSql(List<ColumnConfig> cols)

Implements abstract liquibase.statement.ExecutablePreparedStatementBase.generateSql.

Annotations
@Override
getIndividualStatementsback to summary
public List<ExecutablePreparedStatementBase> getIndividualStatements()

Returns the individual statements that are currently store in this batch.

Returns:List<ExecutablePreparedStatementBase>

the List of the stored statements (may be empty if none are stored)