liquibase.database
Class H2Database

java.lang.Object
  extended by liquibase.database.AbstractDatabase
      extended by liquibase.database.HsqlDatabase
          extended by liquibase.database.H2Database
All Implemented Interfaces:
Database, DatabaseObject

public class H2Database
extends HsqlDatabase


Field Summary
 
Fields inherited from class liquibase.database.AbstractDatabase
currentDateTimeFunction, log
 
Constructor Summary
H2Database()
           
 
Method Summary
 java.lang.Object convertDatabaseValueToJavaObject(java.lang.Object defaultValue, int dataType, int columnSize, int decimalDigits)
           
 SqlStatement createFindSequencesSQL(java.lang.String schema)
           
 java.lang.String getDateTimeType()
          Returns the actual database-specific data type to use a "datetime" column.
 java.lang.String getDefaultDriver(java.lang.String url)
          If this database understands the given url, return the default driver class name.
 java.lang.String getObjectEscapeCharacter()
           
 java.lang.String getProductName()
          Returns the full database product name.
 java.lang.String getTypeName()
          Returns an all-lower-case short name of the product.
 java.lang.String getViewDefinition(java.lang.String schemaName, java.lang.String name)
           
 SqlStatement getViewDefinitionSql(java.lang.String schemaName, java.lang.String name)
           
 boolean isCorrectDatabaseImplementation(java.sql.Connection conn)
          Is this AbstractDatabase subclass the correct one to use for the given connection.
 boolean isLocalDatabase()
          Default implementation, just look for "local" IPs
protected  java.util.Date parseDate(java.lang.String dateAsString)
           
 boolean supportsTablespaces()
           
 
Methods inherited from class liquibase.database.HsqlDatabase
convertRequestedSchemaToSchema, createDatabaseSnapshot, escapeColumnName, escapeTableName, getAutoIncrementClause, getBlobType, getBooleanType, getClobType, getConcatSql, getCurrencyType, getCurrentDateTimeFunction, getDateLiteral, getDefaultDatabaseSchemaName, getUUIDType, setConnection, supportsInitiallyDeferrableColumns, supportsSequences
 
Methods inherited from class liquibase.database.AbstractDatabase
canCreateChangeLogTable, checkDatabaseChangeLogLockTable, checkDatabaseChangeLogTable, close, commit, convertJavaObjectToString, convertRequestedSchemaToCatalog, convertToCorrectJavaType, doesChangeLogLockTableExist, doesChangeLogTableExist, doesTagExist, dropDatabaseObjects, equals, escapeColumnNameList, escapeConstraintName, escapeIndexName, escapeSequenceName, escapeStringForDatabase, escapeViewName, generatePrimaryKeyName, getAutoCommitMode, getBigIntType, getCharType, getColumnType, getColumnType, getConnection, getConnectionURL, getConnectionUsername, getCreateChangeLogLockSQL, getCreateChangeLogSQL, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductName, getDatabaseProductVersion, getDatabaseType, getDateLiteral, getDateLiteral, getDateLiteral, getDateLiteral, getDateType, getDefaultCatalogName, getDefaultSchemaName, getDoubleType, getDriverName, getFalseBooleanValue, getFloatType, getIntType, getJdbcTemplate, getLineComment, getRanChangeSet, getRanChangeSetList, getRanDate, getRunStatus, getSelectChangeLogLockSQL, getSystemTablesAndViews, getTimeType, getTinyIntType, getTrueBooleanValue, getVarcharType, hashCode, isAutoCommit, isColumnAutoIncrement, isDateOnly, isDateTime, isLiquibaseTable, isSystemTable, isSystemView, isTimeOnly, markChangeSetAsRan, markChangeSetAsReRan, removeRanStatus, rollback, setAutoCommit, setConnection, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultSchemaName, setJdbcTemplate, shouldQuoteValue, supportsAutoIncrement, supportsDDLInTransaction, supportsRestrictForeignKeys, supportsSchemas, tag, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

H2Database

public H2Database()
Method Detail

getProductName

public java.lang.String getProductName()
Description copied from interface: Database
Returns the full database product name. May be different than what the JDBC connection reports (getDatabaseProductName())

Specified by:
getProductName in interface Database
Overrides:
getProductName in class HsqlDatabase

getTypeName

public java.lang.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.

Specified by:
getTypeName in interface Database
Overrides:
getTypeName in class HsqlDatabase

getDefaultDriver

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

Specified by:
getDefaultDriver in interface Database
Overrides:
getDefaultDriver in class HsqlDatabase

isCorrectDatabaseImplementation

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

Specified by:
isCorrectDatabaseImplementation in interface Database
Overrides:
isCorrectDatabaseImplementation in class HsqlDatabase
Throws:
JDBCException

createFindSequencesSQL

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

getObjectEscapeCharacter

public java.lang.String getObjectEscapeCharacter()
Overrides:
getObjectEscapeCharacter in class AbstractDatabase

supportsTablespaces

public boolean supportsTablespaces()
Specified by:
supportsTablespaces in interface Database
Overrides:
supportsTablespaces in class HsqlDatabase

getViewDefinition

public java.lang.String getViewDefinition(java.lang.String schemaName,
                                          java.lang.String name)
                                   throws JDBCException
Specified by:
getViewDefinition in interface Database
Overrides:
getViewDefinition in class AbstractDatabase
Throws:
JDBCException

getViewDefinitionSql

public SqlStatement getViewDefinitionSql(java.lang.String schemaName,
                                         java.lang.String name)
                                  throws JDBCException
Overrides:
getViewDefinitionSql in class HsqlDatabase
Throws:
JDBCException

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
Overrides:
convertDatabaseValueToJavaObject in class AbstractDatabase
Throws:
java.text.ParseException

parseDate

protected java.util.Date parseDate(java.lang.String dateAsString)
                            throws DateParseException
Overrides:
parseDate in class HsqlDatabase
Throws:
DateParseException

getDateTimeType

public java.lang.String getDateTimeType()
Description copied from interface: Database
Returns the actual database-specific data type to use a "datetime" column.

Specified by:
getDateTimeType in interface Database
Overrides:
getDateTimeType in class HsqlDatabase

isLocalDatabase

public boolean isLocalDatabase()
                        throws JDBCException
Description copied from class: AbstractDatabase
Default implementation, just look for "local" IPs

Specified by:
isLocalDatabase in interface Database
Overrides:
isLocalDatabase in class AbstractDatabase
Throws:
JDBCException