Package liquibase.statement
Class ExecutablePreparedStatementBase
java.lang.Object
liquibase.statement.ExecutablePreparedStatementBase
- All Implemented Interfaces:
ExecutablePreparedStatement,SqlStatement
- Direct Known Subclasses:
BatchDmlExecutablePreparedStatement,InsertExecutablePreparedStatement,UpdateExecutablePreparedStatement
public abstract class ExecutablePreparedStatementBase
extends Object
implements ExecutablePreparedStatement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
FieldsFields inherited from interface liquibase.statement.SqlStatement
EMPTY_SQL_STATEMENT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExecutablePreparedStatementBase(Database database, String catalogName, String schemaName, String tableName, List<? extends ColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyColumnParameter(PreparedStatement stmt, int i, ColumnConfig col) Sets a single bind variable for a statement to its designated valueprotected StringapplyVisitors(String sql, List<SqlVisitor> sqlVisitors) protected voidattachParams(List<? extends ColumnConfig> cols, PreparedStatement stmt) Sets the list of bind variables for the execution of a DML statementprotected static InputStreamvoidexecute(PreparedStatementFactory factory) Executes the prepared statement created by the given factory.protected voidprotected abstract StringgenerateSql(List<ColumnConfig> cols) protected PreparedStatementgetCachedStatement(String sql) List<? extends ColumnConfig>protected longprotected longgetContentLength(Reader reader) protected InputStreamgetResourceAsStream(String valueLobFile) booleantoBinaryStream(String valueLobFile) protected ExecutablePreparedStatementBase.LOBContent<Reader>toCharacterStream(String valueLobFile, String encoding) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface liquibase.statement.SqlStatement
continueOnError, getFormattedStatement
-
Field Details
-
coreBundle
-
database
-
-
Constructor Details
-
ExecutablePreparedStatementBase
protected ExecutablePreparedStatementBase(Database database, String catalogName, String schemaName, String tableName, List<? extends ColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor)
-
-
Method Details
-
createStream
-
execute
Description copied from interface:ExecutablePreparedStatementExecutes the prepared statement created by the given factory.- Specified by:
executein interfaceExecutablePreparedStatement- Parameters:
factory- a factory for creating aPreparedStatementobject.- Throws:
DatabaseException- if an exception occurs while executing the prepared statement.
-
applyVisitors
-
getCachedStatement
-
executePreparedStatement
- Throws:
SQLException
-
attachParams
protected void attachParams(List<? extends ColumnConfig> cols, PreparedStatement stmt) throws SQLException, DatabaseException Sets the list of bind variables for the execution of a DML statement- Parameters:
cols- 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
-
applyColumnParameter
protected void applyColumnParameter(PreparedStatement stmt, int i, ColumnConfig col) throws SQLException, DatabaseException Sets a single bind variable for a statement to its designated value- Parameters:
stmt- the PreparedStatement whose parameter is to be seti- the parameter index (first bind variable is 1)col- a ColumnConfig with information about the column, its type, and the desired value- 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
-
toBinaryStream
protected ExecutablePreparedStatementBase.LOBContent<InputStream> toBinaryStream(String valueLobFile) throws LiquibaseException, IOException - Throws:
LiquibaseExceptionIOException
-
toCharacterStream
protected ExecutablePreparedStatementBase.LOBContent<Reader> toCharacterStream(String valueLobFile, String encoding) throws IOException, LiquibaseException - Throws:
IOExceptionLiquibaseException
-
getResourceAsStream
- Throws:
IOException
-
skipOnUnsupported
public boolean skipOnUnsupported()- Specified by:
skipOnUnsupportedin interfaceSqlStatement
-
getCatalogName
-
getSchemaName
-
getTableName
-
getColumns
-
getChangeSet
-
getResourceAccessor
-
getContentLength
- Throws:
IOException
-
getContentLength
- Throws:
IOException
-