Package liquibase.database.core
Class AbstractDb2Database
java.lang.Object
liquibase.database.AbstractJdbcDatabase
liquibase.database.core.AbstractDb2Database
- All Implemented Interfaces:
AutoCloseable,Database,PrioritizedService
- Direct Known Subclasses:
DB2Database,Db2zDatabase
-
Field Summary
Fields inherited from class liquibase.database.AbstractJdbcDatabase
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercasedFields inherited from interface liquibase.database.Database
COMPLETE_SQL_SCOPE_KEY, IGNORE_MISSING_REFERENCES_KEYFields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongeneratePrimaryKeyName(String tableName) getDateLiteral(String isoDate) Return an DB2 date literal with the same value as a string formatted using ISO 8601.protected StringgetDefaultDriver(String url) If this database understands the given url, return the default driver class name.getJdbcCatalogName(CatalogAndSchema schema) getJdbcSchemaName(CatalogAndSchema schema) intMost relational databases support 9 fractional digits, and subclasses must overwrite this method if they support less than that.intDB2 database are not case sensitive.getSchemaFromJdbcInfo(String rawCatalogName, String rawSchemaName) getViewDefinition(CatalogAndSchema schema, String viewName) booleanisSystemObject(DatabaseObject example) booleanprotected booleanmustQuoteObjectName(String objectName, Class<? extends DatabaseObject> objectType) booleansupports(Class<? extends DatabaseObject> object) Whether this database supports the specified object type.booleanWhether this database supports catalogsbooleanReturns whether this database support initially deferrable columns.booleanWhether this database supports schemasbooleanMethods inherited from class liquibase.database.AbstractJdbcDatabase
addReservedWords, canCreateChangeLogTable, close, commit, correctObjectName, correctSchema, correctSchema, createsIndexesForForeignKeys, dataTypeIsNotModifiable, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, equals, escapeColumnName, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeDataTypeName, escapeIndexName, escapeObjectName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeRollbackStatements, executeStatements, filterRollbackVisitors, generateAutoIncrementBy, generateAutoIncrementStartWith, generateDatabaseFunctionValue, get, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConcatSql, getConnection, getConnectionCatalogName, getConnectionSchemaName, getConnectionSchemaNameCallStatement, getContainingObjects, getCurrentDateTimeFunction, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDataTypeMaxParameters, getDateFunctions, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultFractionalDigitsForTimestamp, getDefaultScaleForNativeDataType, getDefaultSchema, getDefaultSchemaName, getFetchSize, getJdbcCatalogName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getName, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getQuotingEndCharacter, getQuotingEndReplacement, getQuotingStartCharacter, getRanChangeSet, getRanChangeSetList, getRanDate, getRawDatabaseChangeLogLockTableName, getRawDatabaseChangeLogTableName, getRunStatus, getSystemSchema, getSystemTables, getSystemViews, getTimeLiteral, hashCode, isAutoCommit, isCaseSensitive, isCatalogOrSchemaType, isCurrentTimeFunction, isDateOnly, isDateTime, isDefaultCatalog, isDefaultSchema, isFunction, isLiquibaseObject, isReservedWord, isSafeToRunUpdate, isSystemView, isTimeOnly, isTimestamp, markChangeSetExecStatus, quoteObject, removeRanStatus, requiresExplicitNullForColumns, requiresPassword, requiresUsername, resetInternalState, rollback, saveRollbackStatement, saveStatements, set, setAutoCommit, setCanCacheLiquibaseTableInfo, setCaseSensitive, setConnection, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultCatalogName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, setPreviousAutoCommit, startsWithNumeric, supportsAutoIncrement, supportsBatchUpdates, supportsCatalogInObjectName, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsNotNullConstraintNames, supportsPrimaryKeyNames, supportsRestrictForeignKeys, supportsSequences, tag, toString, unescapeDataTypeName, unescapeDataTypeString, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface liquibase.database.Database
addCompleteSqlToScope, afterUpdate, checkDatabaseConnection, dropDatabaseObjects, escapeForLike, failOnDefferable, generateConnectCommandSuccessMessage, getDisplayName, getShortName, isCorrectDatabaseImplementation, supportsCreateIfNotExists, supportsDatabaseChangeLogHistory, temporarilySetObjectQuotingStrategy
-
Constructor Details
-
AbstractDb2Database
public AbstractDb2Database()
-
-
Method Details
-
getDefaultDriver
Description copied from interface:DatabaseIf this database understands the given url, return the default driver class name. Otherwise return null. -
getPriority
public int getPriority() -
getDefaultPort
-
supports
Description copied from interface:DatabaseWhether this database supports the specified object type. It is invoking the deprecated methods to ensure that extensions are not broken, but once those are removed it will return only true- Parameters:
object- the object type to check- Returns:
- true if the database supports the object type, false otherwise
-
supportsSchemas
public boolean supportsSchemas()Description copied from interface:DatabaseWhether this database supports schemas- Specified by:
supportsSchemasin interfaceDatabase- Overrides:
supportsSchemasin classAbstractJdbcDatabase
-
supportsCatalogs
public boolean supportsCatalogs()Description copied from interface:DatabaseWhether this database supports catalogs- Specified by:
supportsCatalogsin interfaceDatabase- Overrides:
supportsCatalogsin classAbstractJdbcDatabase
-
getDefaultDatabaseProductName
- Specified by:
getDefaultDatabaseProductNamein classAbstractJdbcDatabase
-
getDefaultCatalogName
- Specified by:
getDefaultCatalogNamein interfaceDatabase- Overrides:
getDefaultCatalogNamein classAbstractJdbcDatabase
-
supportsInitiallyDeferrableColumns
public boolean supportsInitiallyDeferrableColumns()Description copied from interface:DatabaseReturns whether this database support initially deferrable columns. -
getDateLiteral
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:
getDateLiteralin interfaceDatabase- Overrides:
getDateLiteralin classAbstractJdbcDatabase
-
supportsTablespaces
public boolean supportsTablespaces() -
getViewDefinition
- Specified by:
getViewDefinitionin interfaceDatabase- Overrides:
getViewDefinitionin classAbstractJdbcDatabase- Throws:
DatabaseException
-
parseDate
- Specified by:
parseDatein interfaceDatabase- Overrides:
parseDatein classAbstractJdbcDatabase- Throws:
DateParseException
-
generatePrimaryKeyName
- Specified by:
generatePrimaryKeyNamein interfaceDatabase- Overrides:
generatePrimaryKeyNamein classAbstractJdbcDatabase
-
getSchemaFromJdbcInfo
- Overrides:
getSchemaFromJdbcInfoin classAbstractJdbcDatabase
-
getJdbcCatalogName
- Overrides:
getJdbcCatalogNamein classAbstractJdbcDatabase
-
getJdbcSchemaName
- Overrides:
getJdbcSchemaNamein classAbstractJdbcDatabase
-
jdbcCallsCatalogsSchemas
public boolean jdbcCallsCatalogsSchemas()- Overrides:
jdbcCallsCatalogsSchemasin classAbstractJdbcDatabase
-
isSystemObject
- Specified by:
isSystemObjectin interfaceDatabase- Overrides:
isSystemObjectin classAbstractJdbcDatabase
-
mustQuoteObjectName
protected boolean mustQuoteObjectName(String objectName, Class<? extends DatabaseObject> objectType) - Overrides:
mustQuoteObjectNamein classAbstractJdbcDatabase
-
getSchemaAndCatalogCase
DB2 database are not case sensitive. However schemas and catalogs are case sensitive- Specified by:
getSchemaAndCatalogCasein interfaceDatabase- Overrides:
getSchemaAndCatalogCasein classAbstractJdbcDatabase- Returns:
- UPPER_CASE by default
-
getMaxFractionalDigitsForTimestamp
public int getMaxFractionalDigitsForTimestamp()Description copied from class:AbstractJdbcDatabaseMost relational databases support 9 fractional digits, and subclasses must overwrite this method if they support less than that.- Specified by:
getMaxFractionalDigitsForTimestampin interfaceDatabase- Overrides:
getMaxFractionalDigitsForTimestampin classAbstractJdbcDatabase- Returns:
- the maximum number of supported fractional digits in TIMESTAMP columns
-