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
Modifier and TypeClassDescriptionprotected static class
-
Field Summary
Fields inherited from interface liquibase.statement.SqlStatement
EMPTY_SQL_STATEMENT
-
Constructor Summary
ModifierConstructorDescriptionprotected
ExecutablePreparedStatementBase
(Database database, String catalogName, String schemaName, String tableName, List<? extends ColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyColumnParameter
(PreparedStatement stmt, int i, ColumnConfig col) Sets a single bind variable for a statement to its designated valueprotected String
applyVisitors
(String sql, List<SqlVisitor> sqlVisitors) protected void
attachParams
(List<? extends ColumnConfig> cols, PreparedStatement stmt) Sets the list of bind variables for the execution of a DML statementprotected static InputStream
void
execute
(PreparedStatementFactory factory) Executes the prepared statement created by the given factory.protected void
protected abstract String
generateSql
(List<ColumnConfig> cols) protected PreparedStatement
getCachedStatement
(String sql) List<? extends ColumnConfig>
protected long
protected long
getContentLength
(Reader reader) protected InputStream
getResourceAsStream
(String valueLobFile) boolean
toBinaryStream
(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, wait
Methods inherited from interface liquibase.statement.SqlStatement
continueOnError
-
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:ExecutablePreparedStatement
Executes the prepared statement created by the given factory.- Specified by:
execute
in interfaceExecutablePreparedStatement
- Parameters:
factory
- a factory for creating aPreparedStatement
object.- 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:
LiquibaseException
IOException
-
toCharacterStream
protected ExecutablePreparedStatementBase.LOBContent<Reader> toCharacterStream(String valueLobFile, String encoding) throws IOException, LiquibaseException - Throws:
IOException
LiquibaseException
-
getResourceAsStream
- Throws:
IOException
-
skipOnUnsupported
public boolean skipOnUnsupported()- Specified by:
skipOnUnsupported
in interfaceSqlStatement
-
getCatalogName
-
getSchemaName
-
getTableName
-
getColumns
-
getChangeSet
-
getResourceAccessor
-
getContentLength
- Throws:
IOException
-
getContentLength
- Throws:
IOException
-