liquibase.database
Class AbstractDatabase

java.lang.Object
  extended by liquibase.database.AbstractDatabase
All Implemented Interfaces:
Database, DatabaseObject
Direct Known Subclasses:
CacheDatabase, DB2Database, DerbyDatabase, FirebirdDatabase, HsqlDatabase, MaxDBDatabase, MSSQLDatabase, MySQLDatabase, OracleDatabase, PostgresDatabase, SQLiteDatabase, SybaseASADatabase, UnsupportedDatabase

public abstract class AbstractDatabase
extends java.lang.Object
implements Database

AbstractDatabase is extended by all supported databases as a facade to the underlying database. The physical connection can be retrieved from the AbstractDatabase implementation, as well as any database-specific characteristics such as the datatype for "boolean" fields.


Field Summary
protected  java.lang.String currentDateTimeFunction
           
protected static java.util.logging.Logger log
           
 
Constructor Summary
protected AbstractDatabase()
           
 
Method Summary
protected  boolean canCreateChangeLogTable()
           
 void checkDatabaseChangeLogLockTable()
          This method will check the database ChangeLogLock table used to keep track of if a machine is updating the database.
 void checkDatabaseChangeLogTable()
          This method will check the database ChangeLog table used to keep track of the changes in the file.
 void close()
           
 void commit()
           
 java.lang.Object convertDatabaseValueToJavaObject(java.lang.Object defaultValue, int dataType, int columnSize, int decimalDigits)
           
 java.lang.String convertJavaObjectToString(java.lang.Object value)
           
 java.lang.String convertRequestedSchemaToCatalog(java.lang.String requestedSchema)
           
 java.lang.String convertRequestedSchemaToSchema(java.lang.String requestedSchema)
           
protected  java.lang.Object convertToCorrectJavaType(java.lang.String value, int dataType, int columnSize, int decimalDigits)
           
abstract  DatabaseSnapshot createDatabaseSnapshot(java.lang.String schema, java.util.Set<DiffStatusListener> statusListeners)
           
 SqlStatement createFindSequencesSQL(java.lang.String schema)
           
 boolean doesChangeLogLockTableExist()
           
 boolean doesChangeLogTableExist()
           
 boolean doesTagExist(java.lang.String tag)
           
 void dropDatabaseObjects(java.lang.String schema)
          Drops all objects owned by the connected user.
 boolean equals(java.lang.Object o)
           
 java.lang.String escapeColumnName(java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName)
          Escapes a single column name in a database-dependent manner so reserved words can be used as a column name (i.e.
 java.lang.String escapeColumnNameList(java.lang.String columnNames)
          Escapes a list of column names in a database-dependent manner so reserved words can be used as a column name (i.e.
 java.lang.String escapeConstraintName(java.lang.String constraintName)
           
 java.lang.String escapeIndexName(java.lang.String schemaName, java.lang.String indexName)
           
 java.lang.String escapeSequenceName(java.lang.String schemaName, java.lang.String sequenceName)
           
 java.lang.String escapeStringForDatabase(java.lang.String string)
           
 java.lang.String escapeTableName(java.lang.String schemaName, java.lang.String tableName)
          Escapes the table name in a database-dependent manner so reserved words can be used as a table name (i.e.
 java.lang.String escapeViewName(java.lang.String schemaName, java.lang.String viewName)
           
 java.lang.String generatePrimaryKeyName(java.lang.String tableName)
           
 boolean getAutoCommitMode()
          Auto-commit mode to run in
 java.lang.String getAutoIncrementClause()
          Returns database-specific auto-increment DDL clause.
 java.lang.String getBigIntType()
           
 java.lang.String getCharType()
          Returns the actual database-specific data type to use for a "char" column.
 java.lang.String getColumnType(ColumnConfig columnConfig)
           
 java.lang.String getColumnType(java.lang.String columnType, java.lang.Boolean autoIncrement)
          Returns the database-specific datatype for the given column configuration.
 java.lang.String getConcatSql(java.lang.String... values)
          Returns SQL to concat the passed values.
 DatabaseConnection getConnection()
           
 java.lang.String getConnectionURL()
           
 java.lang.String getConnectionUsername()
           
protected  SqlStatement getCreateChangeLogLockSQL()
           
protected  SqlStatement getCreateChangeLogSQL()
           
 java.lang.String getDatabaseChangeLogLockTableName()
           
 java.lang.String getDatabaseChangeLogTableName()
           
 int getDatabaseMajorVersion()
           
 int getDatabaseMinorVersion()
           
 java.lang.String getDatabaseProductName()
          Returns the name of the database product according to the underlying database.
 java.lang.String getDatabaseProductName(java.sql.Connection conn)
           
 java.lang.String getDatabaseProductVersion()
           
 int getDatabaseType(int type)
           
 java.lang.String getDateLiteral(java.sql.Date date)
           
 java.lang.String getDateLiteral(java.util.Date date)
           
 java.lang.String getDateLiteral(java.lang.String isoDate)
          Return a date literal with the same value as a string formatted using ISO 8601.
 java.lang.String getDateLiteral(java.sql.Time date)
           
 java.lang.String getDateLiteral(java.sql.Timestamp date)
           
 java.lang.String getDateType()
          Returns the actual database-specific data type to use a "date" (no time information) column.
 java.lang.String getDefaultCatalogName()
           
protected  java.lang.String getDefaultDatabaseSchemaName()
           
 java.lang.String getDefaultSchemaName()
           
 java.lang.String getDoubleType()
          Returns the actual database-specific data type to use for a "double" column.
 java.lang.String getDriverName()
           
 java.lang.String getFalseBooleanValue()
          The database-specific value to use for "false" "boolean" columns.
 java.lang.String getFloatType()
          Returns the actual database-specific data type to use for a "float" column.
 java.lang.String getIntType()
          Returns the actual database-specific data type to use for a "int" column.
 JdbcTemplate getJdbcTemplate()
           
 java.lang.String getLineComment()
          Returns database-specific line comment string.
 java.lang.String getObjectEscapeCharacter()
           
 RanChangeSet getRanChangeSet(ChangeSet changeSet)
           
 java.util.List<RanChangeSet> getRanChangeSetList()
          Returns the ChangeSets that have been run against the current database.
 java.util.Date getRanDate(ChangeSet changeSet)
           
 ChangeSet.RunStatus getRunStatus(ChangeSet changeSet)
          Returns the run status for the given ChangeSet
 SqlStatement getSelectChangeLogLockSQL()
           
protected  java.util.Set<java.lang.String> getSystemTablesAndViews()
          Returns system (undroppable) tables and views.
 java.lang.String getTimeType()
          Returns the actual database-specific data type to use a "time" column.
 java.lang.String getTinyIntType()
          Returns the actual database-specific data type to use for a "tinyint" column.
 java.lang.String getTrueBooleanValue()
          The database-specific value to use for "true" "boolean" columns.
 java.lang.String getVarcharType()
          Returns the actual database-specific data type to use for a "varchar" column.
 java.lang.String getViewDefinition(java.lang.String schemaName, java.lang.String viewName)
           
 SqlStatement getViewDefinitionSql(java.lang.String schemaName, java.lang.String viewName)
           
 int hashCode()
           
 boolean isAutoCommit()
           
 boolean isColumnAutoIncrement(java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName)
           
protected  boolean isDateOnly(java.lang.String isoDate)
           
protected  boolean isDateTime(java.lang.String isoDate)
           
 boolean isLiquibaseTable(java.lang.String tableName)
           
 boolean isLocalDatabase()
          Default implementation, just look for "local" IPs
 boolean isSystemTable(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName)
           
 boolean isSystemView(java.lang.String catalogName, java.lang.String schemaName, java.lang.String viewName)
           
protected  boolean isTimeOnly(java.lang.String isoDate)
           
 void markChangeSetAsRan(ChangeSet changeSet)
          After the change set has been ran against the database this method will update the change log table with the information.
 void markChangeSetAsReRan(ChangeSet changeSet)
           
protected  java.util.Date parseDate(java.lang.String dateAsString)
           
 void removeRanStatus(ChangeSet changeSet)
           
 void rollback()
           
 void setAutoCommit(boolean b)
           
 void setConnection(java.sql.Connection conn)
           
 void setConnection(DatabaseConnection conn)
           
 void setCurrentDateTimeFunction(java.lang.String function)
           
 void setDatabaseChangeLogLockTableName(java.lang.String tableName)
          Set the table name of the change log lock to the given table name
 void setDatabaseChangeLogTableName(java.lang.String tableName)
          Set the table name of the change log to the given table name
 void setDefaultSchemaName(java.lang.String schemaName)
           
 void setJdbcTemplate(JdbcTemplate template)
           
 boolean shouldQuoteValue(java.lang.String value)
           
 boolean supportsAutoIncrement()
           
 boolean supportsDDLInTransaction()
          By default databases should support DDL within a transaction.
 boolean supportsRestrictForeignKeys()
           
 boolean supportsSchemas()
           
 boolean supportsSequences()
          Does the database type support sequence.
 void tag(java.lang.String tagString)
          Tags the database changelog with the given string.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface liquibase.database.Database
getBlobType, getBooleanType, getClobType, getCurrencyType, getCurrentDateTimeFunction, getDateTimeType, getDefaultDriver, getProductName, getTypeName, getUUIDType, isCorrectDatabaseImplementation, supportsInitiallyDeferrableColumns, supportsTablespaces
 

Field Detail

log

protected static final java.util.logging.Logger log

currentDateTimeFunction

protected java.lang.String currentDateTimeFunction
Constructor Detail

AbstractDatabase

protected AbstractDatabase()
Method Detail

getConnection

public DatabaseConnection getConnection()
Specified by:
getConnection in interface Database

setConnection

public void setConnection(java.sql.Connection conn)
Specified by:
setConnection in interface Database

setConnection

public void setConnection(DatabaseConnection conn)
Specified by:
setConnection in interface Database

getAutoCommitMode

public boolean getAutoCommitMode()
Auto-commit mode to run in

Specified by:
getAutoCommitMode in interface Database

supportsDDLInTransaction

public boolean supportsDDLInTransaction()
By default databases should support DDL within a transaction.

Specified by:
supportsDDLInTransaction in interface Database
Returns:
True if the database supports DDL within a transaction, otherwise false.

getDatabaseProductName

public java.lang.String getDatabaseProductName()
Returns the name of the database product according to the underlying database.

Specified by:
getDatabaseProductName in interface Database

getDatabaseProductName

public java.lang.String getDatabaseProductName(java.sql.Connection conn)
                                        throws JDBCException
Specified by:
getDatabaseProductName in interface Database
Throws:
JDBCException

getDatabaseProductVersion

public java.lang.String getDatabaseProductVersion()
                                           throws JDBCException
Specified by:
getDatabaseProductVersion in interface Database
Throws:
JDBCException

getDatabaseMajorVersion

public int getDatabaseMajorVersion()
                            throws JDBCException
Specified by:
getDatabaseMajorVersion in interface Database
Throws:
JDBCException

getDatabaseMinorVersion

public int getDatabaseMinorVersion()
                            throws JDBCException
Specified by:
getDatabaseMinorVersion in interface Database
Throws:
JDBCException

getDriverName

public java.lang.String getDriverName()
                               throws JDBCException
Specified by:
getDriverName in interface Database
Throws:
JDBCException

getConnectionURL

public java.lang.String getConnectionURL()
                                  throws JDBCException
Specified by:
getConnectionURL in interface Database
Throws:
JDBCException

getConnectionUsername

public java.lang.String getConnectionUsername()
                                       throws JDBCException
Specified by:
getConnectionUsername in interface Database
Throws:
JDBCException

getDefaultCatalogName

public java.lang.String getDefaultCatalogName()
                                       throws JDBCException
Specified by:
getDefaultCatalogName in interface Database
Throws:
JDBCException

getDefaultDatabaseSchemaName

protected java.lang.String getDefaultDatabaseSchemaName()
                                                 throws JDBCException
Throws:
JDBCException

getDefaultSchemaName

public java.lang.String getDefaultSchemaName()
Specified by:
getDefaultSchemaName in interface Database

setDefaultSchemaName

public void setDefaultSchemaName(java.lang.String schemaName)
                          throws JDBCException
Specified by:
setDefaultSchemaName in interface Database
Throws:
JDBCException

getSystemTablesAndViews

protected java.util.Set<java.lang.String> getSystemTablesAndViews()
Returns system (undroppable) tables and views.


supportsSequences

public boolean supportsSequences()
Does the database type support sequence.

Specified by:
supportsSequences in interface Database

supportsAutoIncrement

public boolean supportsAutoIncrement()
Specified by:
supportsAutoIncrement in interface Database

setCurrentDateTimeFunction

public void setCurrentDateTimeFunction(java.lang.String function)
Specified by:
setCurrentDateTimeFunction in interface Database

getColumnType

public java.lang.String getColumnType(java.lang.String columnType,
                                      java.lang.Boolean autoIncrement)
Returns the database-specific datatype for the given column configuration. This method will convert some generic column types (e.g. boolean, currency) to the correct type for the current database.

Specified by:
getColumnType in interface Database

getColumnType

public final java.lang.String getColumnType(ColumnConfig columnConfig)

getFalseBooleanValue

public java.lang.String getFalseBooleanValue()
The database-specific value to use for "false" "boolean" columns.

Specified by:
getFalseBooleanValue in interface Database

getTrueBooleanValue

public java.lang.String getTrueBooleanValue()
The database-specific value to use for "true" "boolean" columns.

Specified by:
getTrueBooleanValue in interface Database

getDateLiteral

public java.lang.String getDateLiteral(java.lang.String isoDate)
Return a date literal with the same value as a string formatted using ISO 8601.

Note: many databases accept date literals in ISO8601 format with the 'T' replaced with a space. Only databases which do not accept these strings should need to override this method.

Implementation restriction: Currently, only the following subsets of ISO8601 are supported: yyyy-MM-dd hh:mm:ss yyyy-MM-ddThh:mm:ss

Specified by:
getDateLiteral in interface Database

getDateLiteral

public java.lang.String getDateLiteral(java.sql.Timestamp date)
Specified by:
getDateLiteral in interface Database

getDateLiteral

public java.lang.String getDateLiteral(java.sql.Date date)
Specified by:
getDateLiteral in interface Database

getDateLiteral

public java.lang.String getDateLiteral(java.sql.Time date)
Specified by:
getDateLiteral in interface Database

getDateLiteral

public java.lang.String getDateLiteral(java.util.Date date)
Specified by:
getDateLiteral in interface Database

parseDate

protected java.util.Date parseDate(java.lang.String dateAsString)
                            throws DateParseException
Throws:
DateParseException

isDateOnly

protected boolean isDateOnly(java.lang.String isoDate)

isDateTime

protected boolean isDateTime(java.lang.String isoDate)

isTimeOnly

protected boolean isTimeOnly(java.lang.String isoDate)

getDateType

public java.lang.String getDateType()
Returns the actual database-specific data type to use a "date" (no time information) column.

Specified by:
getDateType in interface Database

getTimeType

public java.lang.String getTimeType()
Returns the actual database-specific data type to use a "time" column.

Specified by:
getTimeType in interface Database

getBigIntType

public java.lang.String getBigIntType()
Specified by:
getBigIntType in interface Database

getCharType

public java.lang.String getCharType()
Returns the actual database-specific data type to use for a "char" column.

Specified by:
getCharType in interface Database

getVarcharType

public java.lang.String getVarcharType()
Returns the actual database-specific data type to use for a "varchar" column.

Specified by:
getVarcharType in interface Database

getFloatType

public java.lang.String getFloatType()
Returns the actual database-specific data type to use for a "float" column.

Specified by:
getFloatType in interface Database
Returns:
database-specific type for float

getDoubleType

public java.lang.String getDoubleType()
Returns the actual database-specific data type to use for a "double" column.

Specified by:
getDoubleType in interface Database
Returns:
database-specific type for double

getIntType

public java.lang.String getIntType()
Returns the actual database-specific data type to use for a "int" column.

Specified by:
getIntType in interface Database
Returns:
database-specific type for int

getTinyIntType

public java.lang.String getTinyIntType()
Returns the actual database-specific data type to use for a "tinyint" column.

Specified by:
getTinyIntType in interface Database
Returns:
database-specific type for tinyint

getLineComment

public java.lang.String getLineComment()
Returns database-specific line comment string.

Specified by:
getLineComment in interface Database

getAutoIncrementClause

public java.lang.String getAutoIncrementClause()
Returns database-specific auto-increment DDL clause.

Specified by:
getAutoIncrementClause in interface Database

getConcatSql

public java.lang.String getConcatSql(java.lang.String... values)
Description copied from interface: Database
Returns SQL to concat the passed values.

Specified by:
getConcatSql in interface Database

getDatabaseChangeLogTableName

public java.lang.String getDatabaseChangeLogTableName()
Specified by:
getDatabaseChangeLogTableName in interface Database
See Also:
Database.getDatabaseChangeLogTableName()

getDatabaseChangeLogLockTableName

public java.lang.String getDatabaseChangeLogLockTableName()
Specified by:
getDatabaseChangeLogLockTableName in interface Database
See Also:
Database.getDatabaseChangeLogLockTableName()

setDatabaseChangeLogTableName

public void setDatabaseChangeLogTableName(java.lang.String tableName)
Description copied from interface: Database
Set the table name of the change log to the given table name

Specified by:
setDatabaseChangeLogTableName in interface Database
See Also:
Database.setDatabaseChangeLogTableName(java.lang.String)

setDatabaseChangeLogLockTableName

public void setDatabaseChangeLogLockTableName(java.lang.String tableName)
Description copied from interface: Database
Set the table name of the change log lock to the given table name

Specified by:
setDatabaseChangeLogLockTableName in interface Database
See Also:
Database.setDatabaseChangeLogLockTableName(java.lang.String)

getCreateChangeLogLockSQL

protected SqlStatement getCreateChangeLogLockSQL()

getCreateChangeLogSQL

protected SqlStatement getCreateChangeLogSQL()

getSelectChangeLogLockSQL

public SqlStatement getSelectChangeLogLockSQL()
                                       throws JDBCException
Specified by:
getSelectChangeLogLockSQL in interface Database
Throws:
JDBCException

doesChangeLogTableExist

public boolean doesChangeLogTableExist()
                                throws JDBCException
Specified by:
doesChangeLogTableExist in interface Database
Throws:
JDBCException

checkDatabaseChangeLogTable

public void checkDatabaseChangeLogTable()
                                 throws JDBCException
This method will check the database ChangeLog table used to keep track of the changes in the file. If the table does not exist it will create one otherwise it will not do anything besides outputting a log message.

Specified by:
checkDatabaseChangeLogTable in interface Database
Throws:
JDBCException

canCreateChangeLogTable

protected boolean canCreateChangeLogTable()
                                   throws JDBCException
Throws:
JDBCException

doesChangeLogLockTableExist

public boolean doesChangeLogLockTableExist()
                                    throws JDBCException
Specified by:
doesChangeLogLockTableExist in interface Database
Throws:
JDBCException

checkDatabaseChangeLogLockTable

public void checkDatabaseChangeLogLockTable()
                                     throws JDBCException
This method will check the database ChangeLogLock table used to keep track of if a machine is updating the database. If the table does not exist it will create one otherwise it will not do anything besides outputting a log message.

Specified by:
checkDatabaseChangeLogLockTable in interface Database
Throws:
JDBCException

dropDatabaseObjects

public void dropDatabaseObjects(java.lang.String schema)
                         throws JDBCException
Drops all objects owned by the connected user.

Specified by:
dropDatabaseObjects in interface Database
Parameters:
schema -
Throws:
JDBCException

isSystemTable

public boolean isSystemTable(java.lang.String catalogName,
                             java.lang.String schemaName,
                             java.lang.String tableName)
Specified by:
isSystemTable in interface Database

isSystemView

public boolean isSystemView(java.lang.String catalogName,
                            java.lang.String schemaName,
                            java.lang.String viewName)
Specified by:
isSystemView in interface Database

isLiquibaseTable

public boolean isLiquibaseTable(java.lang.String tableName)
Specified by:
isLiquibaseTable in interface Database

tag

public void tag(java.lang.String tagString)
         throws JDBCException
Tags the database changelog with the given string.

Specified by:
tag in interface Database
Throws:
JDBCException

createFindSequencesSQL

public SqlStatement createFindSequencesSQL(java.lang.String schema)
                                    throws JDBCException
Specified by:
createFindSequencesSQL in interface Database
Throws:
JDBCException

doesTagExist

public boolean doesTagExist(java.lang.String tag)
                     throws JDBCException
Specified by:
doesTagExist in interface Database
Throws:
JDBCException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

shouldQuoteValue

public boolean shouldQuoteValue(java.lang.String value)
Specified by:
shouldQuoteValue in interface Database

getViewDefinition

public java.lang.String getViewDefinition(java.lang.String schemaName,
                                          java.lang.String viewName)
                                   throws JDBCException
Specified by:
getViewDefinition in interface Database
Throws:
JDBCException

getViewDefinitionSql

public SqlStatement getViewDefinitionSql(java.lang.String schemaName,
                                         java.lang.String viewName)
                                  throws JDBCException
Throws:
JDBCException

getDatabaseType

public int getDatabaseType(int type)
Specified by:
getDatabaseType in interface Database

convertDatabaseValueToJavaObject

public java.lang.Object convertDatabaseValueToJavaObject(java.lang.Object defaultValue,
                                                         int dataType,
                                                         int columnSize,
                                                         int decimalDigits)
                                                  throws java.text.ParseException
Specified by:
convertDatabaseValueToJavaObject in interface Database
Throws:
java.text.ParseException

convertToCorrectJavaType

protected java.lang.Object convertToCorrectJavaType(java.lang.String value,
                                                    int dataType,
                                                    int columnSize,
                                                    int decimalDigits)
                                             throws java.text.ParseException
Throws:
java.text.ParseException

convertJavaObjectToString

public java.lang.String convertJavaObjectToString(java.lang.Object value)
Specified by:
convertJavaObjectToString in interface Database

escapeTableName

public java.lang.String escapeTableName(java.lang.String schemaName,
                                        java.lang.String tableName)
Description copied from interface: Database
Escapes the table name in a database-dependent manner so reserved words can be used as a table name (i.e. "order"). Currently only escapes MS-SQL because other DBMSs store table names case-sensitively when escaping is used which could confuse end-users. Pass null to schemaName to use the default schema

Specified by:
escapeTableName in interface Database

getObjectEscapeCharacter

public java.lang.String getObjectEscapeCharacter()

escapeIndexName

public java.lang.String escapeIndexName(java.lang.String schemaName,
                                        java.lang.String indexName)
Specified by:
escapeIndexName in interface Database

escapeSequenceName

public java.lang.String escapeSequenceName(java.lang.String schemaName,
                                           java.lang.String sequenceName)
Specified by:
escapeSequenceName in interface Database

escapeConstraintName

public java.lang.String escapeConstraintName(java.lang.String constraintName)
Specified by:
escapeConstraintName in interface Database

escapeColumnName

public java.lang.String escapeColumnName(java.lang.String schemaName,
                                         java.lang.String tableName,
                                         java.lang.String columnName)
Description copied from interface: Database
Escapes a single column name in a database-dependent manner so reserved words can be used as a column name (i.e. "return").

Specified by:
escapeColumnName in interface Database
columnName - column name
Returns:
escaped column name

escapeColumnNameList

public java.lang.String escapeColumnNameList(java.lang.String columnNames)
Description copied from interface: Database
Escapes a list of column names in a database-dependent manner so reserved words can be used as a column name (i.e. "return").

Specified by:
escapeColumnNameList in interface Database
Parameters:
columnNames - list of column names
Returns:
escaped column name list

convertRequestedSchemaToCatalog

public java.lang.String convertRequestedSchemaToCatalog(java.lang.String requestedSchema)
                                                 throws JDBCException
Specified by:
convertRequestedSchemaToCatalog in interface Database
Throws:
JDBCException

convertRequestedSchemaToSchema

public java.lang.String convertRequestedSchemaToSchema(java.lang.String requestedSchema)
                                                throws JDBCException
Specified by:
convertRequestedSchemaToSchema in interface Database
Throws:
JDBCException

supportsSchemas

public boolean supportsSchemas()
Specified by:
supportsSchemas in interface Database

generatePrimaryKeyName

public java.lang.String generatePrimaryKeyName(java.lang.String tableName)
Specified by:
generatePrimaryKeyName in interface Database

escapeViewName

public java.lang.String escapeViewName(java.lang.String schemaName,
                                       java.lang.String viewName)
Specified by:
escapeViewName in interface Database

isColumnAutoIncrement

public boolean isColumnAutoIncrement(java.lang.String schemaName,
                                     java.lang.String tableName,
                                     java.lang.String columnName)
                              throws java.sql.SQLException,
                                     JDBCException
Specified by:
isColumnAutoIncrement in interface Database
Throws:
java.sql.SQLException
JDBCException

getRunStatus

public ChangeSet.RunStatus getRunStatus(ChangeSet changeSet)
                                 throws JDBCException,
                                        DatabaseHistoryException
Returns the run status for the given ChangeSet

Specified by:
getRunStatus in interface Database
Throws:
JDBCException
DatabaseHistoryException

getRanChangeSet

public RanChangeSet getRanChangeSet(ChangeSet changeSet)
                             throws JDBCException,
                                    DatabaseHistoryException
Specified by:
getRanChangeSet in interface Database
Throws:
JDBCException
DatabaseHistoryException

getRanChangeSetList

public java.util.List<RanChangeSet> getRanChangeSetList()
                                                 throws JDBCException
Returns the ChangeSets that have been run against the current database.

Specified by:
getRanChangeSetList in interface Database
Throws:
JDBCException

getRanDate

public java.util.Date getRanDate(ChangeSet changeSet)
                          throws JDBCException,
                                 DatabaseHistoryException
Specified by:
getRanDate in interface Database
Throws:
JDBCException
DatabaseHistoryException

markChangeSetAsRan

public void markChangeSetAsRan(ChangeSet changeSet)
                        throws JDBCException
After the change set has been ran against the database this method will update the change log table with the information.

Specified by:
markChangeSetAsRan in interface Database
Throws:
JDBCException

markChangeSetAsReRan

public void markChangeSetAsReRan(ChangeSet changeSet)
                          throws JDBCException
Specified by:
markChangeSetAsReRan in interface Database
Throws:
JDBCException

removeRanStatus

public void removeRanStatus(ChangeSet changeSet)
                     throws JDBCException
Specified by:
removeRanStatus in interface Database
Throws:
JDBCException

escapeStringForDatabase

public java.lang.String escapeStringForDatabase(java.lang.String string)
Specified by:
escapeStringForDatabase in interface Database

commit

public void commit()
            throws JDBCException
Specified by:
commit in interface Database
Throws:
JDBCException

rollback

public void rollback()
              throws JDBCException
Specified by:
rollback in interface Database
Throws:
JDBCException

getJdbcTemplate

public JdbcTemplate getJdbcTemplate()
Specified by:
getJdbcTemplate in interface Database

setJdbcTemplate

public void setJdbcTemplate(JdbcTemplate template)
Specified by:
setJdbcTemplate in interface Database

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

close

public void close()
           throws JDBCException
Specified by:
close in interface Database
Throws:
JDBCException

createDatabaseSnapshot

public abstract DatabaseSnapshot createDatabaseSnapshot(java.lang.String schema,
                                                        java.util.Set<DiffStatusListener> statusListeners)
                                                 throws JDBCException
Specified by:
createDatabaseSnapshot in interface Database
Throws:
JDBCException

supportsRestrictForeignKeys

public boolean supportsRestrictForeignKeys()
Specified by:
supportsRestrictForeignKeys in interface Database

isAutoCommit

public boolean isAutoCommit()
                     throws JDBCException
Specified by:
isAutoCommit in interface Database
Throws:
JDBCException

setAutoCommit

public void setAutoCommit(boolean b)
                   throws JDBCException
Specified by:
setAutoCommit in interface Database
Throws:
JDBCException

isLocalDatabase

public boolean isLocalDatabase()
                        throws JDBCException
Default implementation, just look for "local" IPs

Specified by:
isLocalDatabase in interface Database
Throws:
JDBCException