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, unquotedObjectsAreUppercased
Fields inherited from interface liquibase.database.Database
COMPLETE_SQL_SCOPE_KEY
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
-
Constructor Summary
-
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 String
getDefaultDriver
(String url) If this database understands the given url, return the default driver class name.getJdbcCatalogName
(CatalogAndSchema schema) getJdbcSchemaName
(CatalogAndSchema schema) int
Most relational databases support 9 fractional digits, and subclasses must overwrite this method if they support less than that.int
DB2 database are not case sensitive.getSchemaFromJdbcInfo
(String rawCatalogName, String rawSchemaName) getViewDefinition
(CatalogAndSchema schema, String viewName) boolean
isSystemObject
(DatabaseObject example) boolean
protected boolean
mustQuoteObjectName
(String objectName, Class<? extends DatabaseObject> objectType) boolean
supports
(Class<? extends DatabaseObject> object) Whether this database supports the specified object type.boolean
Whether this database supports catalogsboolean
Returns whether this database support initially deferrable columns.boolean
Whether this database supports schemasboolean
Methods 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, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface liquibase.database.Database
addCompleteSqlToScope, afterUpdate, checkDatabaseConnection, dropDatabaseObjects, failOnDefferable, generateConnectCommandSuccessMessage, getDisplayName, getShortName, isCorrectDatabaseImplementation, supportsCreateIfNotExists, supportsDatabaseChangeLogHistory, temporarilySetObjectQuotingStrategy
-
Constructor Details
-
AbstractDb2Database
public AbstractDb2Database()
-
-
Method Details
-
getDefaultDriver
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
-
supports
Description copied from interface:Database
Whether 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:Database
Whether this database supports schemas- Specified by:
supportsSchemas
in interfaceDatabase
- Overrides:
supportsSchemas
in classAbstractJdbcDatabase
-
supportsCatalogs
public boolean supportsCatalogs()Description copied from interface:Database
Whether this database supports catalogs- Specified by:
supportsCatalogs
in interfaceDatabase
- Overrides:
supportsCatalogs
in classAbstractJdbcDatabase
-
getDefaultDatabaseProductName
- Specified by:
getDefaultDatabaseProductName
in classAbstractJdbcDatabase
-
getDefaultCatalogName
- Specified by:
getDefaultCatalogName
in interfaceDatabase
- Overrides:
getDefaultCatalogName
in classAbstractJdbcDatabase
-
supportsInitiallyDeferrableColumns
public boolean supportsInitiallyDeferrableColumns()Description copied from interface:Database
Returns 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:
getDateLiteral
in interfaceDatabase
- Overrides:
getDateLiteral
in classAbstractJdbcDatabase
-
supportsTablespaces
public boolean supportsTablespaces() -
getViewDefinition
- Specified by:
getViewDefinition
in interfaceDatabase
- Overrides:
getViewDefinition
in classAbstractJdbcDatabase
- Throws:
DatabaseException
-
parseDate
- Specified by:
parseDate
in interfaceDatabase
- Overrides:
parseDate
in classAbstractJdbcDatabase
- Throws:
DateParseException
-
generatePrimaryKeyName
- Specified by:
generatePrimaryKeyName
in interfaceDatabase
- Overrides:
generatePrimaryKeyName
in classAbstractJdbcDatabase
-
getSchemaFromJdbcInfo
- Overrides:
getSchemaFromJdbcInfo
in classAbstractJdbcDatabase
-
getJdbcCatalogName
- Overrides:
getJdbcCatalogName
in classAbstractJdbcDatabase
-
getJdbcSchemaName
- Overrides:
getJdbcSchemaName
in classAbstractJdbcDatabase
-
jdbcCallsCatalogsSchemas
public boolean jdbcCallsCatalogsSchemas()- Overrides:
jdbcCallsCatalogsSchemas
in classAbstractJdbcDatabase
-
isSystemObject
- Specified by:
isSystemObject
in interfaceDatabase
- Overrides:
isSystemObject
in classAbstractJdbcDatabase
-
mustQuoteObjectName
protected boolean mustQuoteObjectName(String objectName, Class<? extends DatabaseObject> objectType) - Overrides:
mustQuoteObjectName
in classAbstractJdbcDatabase
-
getSchemaAndCatalogCase
DB2 database are not case sensitive. However schemas and catalogs are case sensitive- Specified by:
getSchemaAndCatalogCase
in interfaceDatabase
- Overrides:
getSchemaAndCatalogCase
in classAbstractJdbcDatabase
- Returns:
- UPPER_CASE by default
-
getMaxFractionalDigitsForTimestamp
public int getMaxFractionalDigitsForTimestamp()Description copied from class:AbstractJdbcDatabase
Most relational databases support 9 fractional digits, and subclasses must overwrite this method if they support less than that.- Specified by:
getMaxFractionalDigitsForTimestamp
in interfaceDatabase
- Overrides:
getMaxFractionalDigitsForTimestamp
in classAbstractJdbcDatabase
- Returns:
- the maximum number of supported fractional digits in TIMESTAMP columns
-