liquibase.database.core
Class DB2Database

java.lang.Object
  extended by liquibase.database.AbstractDatabase
      extended by liquibase.database.core.DB2Database
All Implemented Interfaces:
Database, DatabaseObject, PrioritizedService

public class DB2Database
extends AbstractDatabase


Field Summary
 
Fields inherited from class liquibase.database.AbstractDatabase
currentDateTimeFunction, databaseFunctions
 
Fields inherited from interface liquibase.servicelocator.PrioritizedService
PRIORITY_DATABASE, PRIORITY_DEFAULT
 
Constructor Summary
DB2Database()
           
 
Method Summary
 String convertRequestedSchemaToCatalog(String requestedSchema)
           
 String convertRequestedSchemaToSchema(String requestedSchema)
           
 String escapeIndexName(String schemaName, String indexName)
           
 String generatePrimaryKeyName(String tableName)
           
 String getAutoIncrementClause()
          Returns database-specific auto-increment DDL clause.
 String getCurrentDateTimeFunction()
          Returns database-specific function for generating the current date/time.
 String getDateLiteral(String isoDate)
          Return an DB2 date literal with the same value as a string formatted using ISO 8601.
protected  String getDefaultDatabaseSchemaName()
           
 String getDefaultDriver(String url)
          If this database understands the given url, return the default driver class name.
 int getPriority()
           
 String getTypeName()
          Returns an all-lower-case short name of the product.
 String getViewDefinition(String schemaName, String name)
           
 boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
          Is this AbstractDatabase subclass the correct one to use for the given connection.
 Date parseDate(String dateAsString)
           
 boolean shouldQuoteValue(String value)
           
 boolean supportsInitiallyDeferrableColumns()
          Returns whether this database support initially deferrable columns.
 boolean supportsTablespaces()
           
 
Methods inherited from class liquibase.database.AbstractDatabase
canCreateChangeLogTable, checkDatabaseChangeLogLockTable, checkDatabaseChangeLogTable, close, commit, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, equals, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeDatabaseObject, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeStatements, getAutoCommitMode, getConcatSql, getConnection, getContainingObjects, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseFunctions, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultCatalogName, getDefaultSchemaName, getLineComment, getLiquibaseSchemaName, getNextChangeSetSequenceValue, getRanChangeSet, getRanChangeSetList, getRanDate, getRunStatus, getSystemTablesAndViews, getTable, getTimeLiteral, hasDatabaseChangeLogLockTable, hasDatabaseChangeLogTable, hashCode, isAutoCommit, isDateOnly, isDateTime, isLiquibaseTable, isLocalDatabase, isReservedWord, isSystemTable, isSystemView, isTimeOnly, markChangeSetExecStatus, removeRanStatus, requiresPassword, requiresUsername, reset, rollback, saveRollbackStatement, saveStatements, setAutoCommit, setCanCacheLiquibaseTableInfo, setConnection, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultSchemaName, supportsAutoIncrement, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsRestrictForeignKeys, supportsSchemas, 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()

getTypeName

public String getTypeName()
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.


getDefaultDatabaseSchemaName

protected String getDefaultDatabaseSchemaName()
                                       throws DatabaseException
Overrides:
getDefaultDatabaseSchemaName in class AbstractDatabase
Throws:
DatabaseException

supportsInitiallyDeferrableColumns

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


getAutoIncrementClause

public String getAutoIncrementClause()
Description copied from class: AbstractDatabase
Returns database-specific auto-increment DDL clause.

Specified by:
getAutoIncrementClause in interface Database
Overrides:
getAutoIncrementClause in class AbstractDatabase

getCurrentDateTimeFunction

public String getCurrentDateTimeFunction()
Description copied from interface: Database
Returns database-specific function for generating the current date/time.


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 AbstractDatabase

shouldQuoteValue

public boolean shouldQuoteValue(String value)
Specified by:
shouldQuoteValue in interface Database
Overrides:
shouldQuoteValue in class AbstractDatabase

supportsTablespaces

public boolean supportsTablespaces()

getViewDefinition

public String getViewDefinition(String schemaName,
                                String name)
                         throws DatabaseException
Specified by:
getViewDefinition in interface Database
Overrides:
getViewDefinition in class AbstractDatabase
Throws:
DatabaseException

parseDate

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

convertRequestedSchemaToSchema

public String convertRequestedSchemaToSchema(String requestedSchema)
                                      throws DatabaseException
Specified by:
convertRequestedSchemaToSchema in interface Database
Overrides:
convertRequestedSchemaToSchema in class AbstractDatabase
Throws:
DatabaseException

convertRequestedSchemaToCatalog

public String convertRequestedSchemaToCatalog(String requestedSchema)
                                       throws DatabaseException
Specified by:
convertRequestedSchemaToCatalog in interface Database
Overrides:
convertRequestedSchemaToCatalog in class AbstractDatabase
Throws:
DatabaseException

generatePrimaryKeyName

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

escapeIndexName

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


Copyright © 2004-2011 Liquibase.org. All Rights Reserved.