liquibase.database.core
Class DB2Database

java.lang.Object
  extended by liquibase.database.AbstractJdbcDatabase
      extended by liquibase.database.core.DB2Database
All Implemented Interfaces:
Database, PrioritizedService
Direct Known Subclasses:
DB2iDatabase

public class DB2Database
extends AbstractJdbcDatabase


Field Summary
 
Fields inherited from class liquibase.database.AbstractJdbcDatabase
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingEndCharacter, quotingStartCharacter, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercased
 
Fields inherited from interface liquibase.servicelocator.PrioritizedService
PRIORITY_DATABASE, PRIORITY_DEFAULT
 
Constructor Summary
DB2Database()
           
 
Method Summary
 String correctObjectName(String objectName, Class<? extends DatabaseObject> objectType)
          Fix the object name to the format the database expects, handling changes in case, etc.
 String escapeIndexName(String catalogName, String schemaName, String indexName)
           
 String generatePrimaryKeyName(String tableName)
           
 String getDateLiteral(String isoDate)
          Return an DB2 date literal with the same value as a string formatted using ISO 8601.
 String getDefaultCatalogName()
           
protected  String getDefaultDatabaseProductName()
           
 String getDefaultDriver(String url)
          If this database understands the given url, return the default driver class name.
 Integer getDefaultPort()
           
 String getJdbcCatalogName(CatalogAndSchema schema)
           
 String getJdbcSchemaName(CatalogAndSchema schema)
           
 int getPriority()
           
 CatalogAndSchema getSchemaFromJdbcInfo(String rawCatalogName, String rawSchemaName)
           
 String getShortName()
          Returns an all-lower-case short name of the product.
 String getViewDefinition(CatalogAndSchema schema, String name)
           
 boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
          Is this AbstractDatabase subclass the correct one to use for the given connection.
 boolean jdbcCallsCatalogsSchemas()
           
 Date parseDate(String dateAsString)
           
 boolean supportsCatalogs()
           
 boolean supportsInitiallyDeferrableColumns()
          Returns whether this database support initially deferrable columns.
 boolean supportsSchemas()
           
 boolean supportsTablespaces()
           
 
Methods inherited from class liquibase.database.AbstractJdbcDatabase
canCreateChangeLogTable, checkDatabaseChangeLogLockTable, checkDatabaseChangeLogTable, close, commit, correctSchema, correctSchema, createsIndexesForForeignKeys, dataTypeIsNotModifiable, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, equals, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeObjectName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeStatements, generateAutoIncrementBy, generateAutoIncrementStartWith, generateDatabaseFunctionValue, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConcatSql, getConnection, getConnectionCatalogName, getConnectionSchemaName, getContainingObjects, getCurrentDateTimeFunction, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDataTypeMaxParameters, getDateFunctions, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultSchema, getDefaultSchemaName, getJdbcCatalogName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getName, getNextChangeSetSequenceValue, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getRanChangeSet, getRanChangeSetList, getRanDate, getRunStatus, getSystemSchema, getSystemTables, getSystemViews, getTimeLiteral, hasDatabaseChangeLogLockTable, hasDatabaseChangeLogTable, hashCode, isAutoCommit, isCaseSensitive, isDatabaseChangeLogLockTableInitialized, isDateOnly, isDateTime, isDefaultCatalog, isDefaultSchema, isFunction, isLiquibaseObject, isReservedWord, isSafeToRunUpdate, isSystemObject, isSystemView, isTimeOnly, markChangeSetExecStatus, mustQuoteObjectName, quoteObject, removeRanStatus, requiresPassword, requiresUsername, resetInternalState, resetRanChangeSetList, rollback, saveRollbackStatement, saveStatements, setAutoCommit, setCanCacheLiquibaseTableInfo, setConnection, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultCatalogName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, startsWithNumeric, supportsAutoIncrement, supportsCatalogInObjectName, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsPrimaryKeyNames, supportsRestrictForeignKeys, supportsSequences, tag, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DB2Database

public DB2Database()
Method Detail

isCorrectDatabaseImplementation

public boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
                                        throws DatabaseException
Description copied from interface: Database
Is this AbstractDatabase subclass the correct one to use for the given connection.

Throws:
DatabaseException

getDefaultDriver

public String getDefaultDriver(String url)
Description copied from interface: Database
If this database understands the given url, return the default driver class name. Otherwise return null.


getPriority

public int getPriority()

getDefaultPort

public Integer getDefaultPort()

supportsSchemas

public boolean supportsSchemas()
Specified by:
supportsSchemas in interface Database
Overrides:
supportsSchemas in class AbstractJdbcDatabase

supportsCatalogs

public boolean supportsCatalogs()
Specified by:
supportsCatalogs in interface Database
Overrides:
supportsCatalogs in class AbstractJdbcDatabase

getDefaultDatabaseProductName

protected String getDefaultDatabaseProductName()
Specified by:
getDefaultDatabaseProductName in class AbstractJdbcDatabase

getShortName

public String getShortName()
Description copied from interface: Database
Returns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition.


getDefaultCatalogName

public String getDefaultCatalogName()
Specified by:
getDefaultCatalogName in interface Database
Overrides:
getDefaultCatalogName in class AbstractJdbcDatabase

correctObjectName

public String correctObjectName(String objectName,
                                Class<? extends DatabaseObject> objectType)
Description copied from interface: Database
Fix the object name to the format the database expects, handling changes in case, etc.

Specified by:
correctObjectName in interface Database
Overrides:
correctObjectName in class AbstractJdbcDatabase

supportsInitiallyDeferrableColumns

public boolean supportsInitiallyDeferrableColumns()
Description copied from interface: Database
Returns whether this database support initially deferrable columns.


getDateLiteral

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

Convert an ISO8601 date string to one of the following results: to_date('1995-05-23', 'YYYY-MM-DD') to_date('1995-05-23 09:23:59', 'YYYY-MM-DD HH24:MI:SS')

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
Overrides:
getDateLiteral in class AbstractJdbcDatabase

supportsTablespaces

public boolean supportsTablespaces()

getViewDefinition

public String getViewDefinition(CatalogAndSchema schema,
                                String name)
                         throws DatabaseException
Specified by:
getViewDefinition in interface Database
Overrides:
getViewDefinition in class AbstractJdbcDatabase
Throws:
DatabaseException

parseDate

public Date parseDate(String dateAsString)
               throws DateParseException
Specified by:
parseDate in interface Database
Overrides:
parseDate in class AbstractJdbcDatabase
Throws:
DateParseException

generatePrimaryKeyName

public String generatePrimaryKeyName(String tableName)
Specified by:
generatePrimaryKeyName in interface Database
Overrides:
generatePrimaryKeyName in class AbstractJdbcDatabase

escapeIndexName

public String escapeIndexName(String catalogName,
                              String schemaName,
                              String indexName)
Specified by:
escapeIndexName in interface Database
Overrides:
escapeIndexName in class AbstractJdbcDatabase

getSchemaFromJdbcInfo

public CatalogAndSchema getSchemaFromJdbcInfo(String rawCatalogName,
                                              String rawSchemaName)
Overrides:
getSchemaFromJdbcInfo in class AbstractJdbcDatabase

getJdbcCatalogName

public String getJdbcCatalogName(CatalogAndSchema schema)
Overrides:
getJdbcCatalogName in class AbstractJdbcDatabase

getJdbcSchemaName

public String getJdbcSchemaName(CatalogAndSchema schema)
Overrides:
getJdbcSchemaName in class AbstractJdbcDatabase

jdbcCallsCatalogsSchemas

public boolean jdbcCallsCatalogsSchemas()
Overrides:
jdbcCallsCatalogsSchemas in class AbstractJdbcDatabase


Copyright © 2013 Liquibase.org. All Rights Reserved.