Package liquibase.database
Interface DatabaseConnection
-
- All Superinterfaces:
AutoCloseable
,PrioritizedService
- All Known Implementing Classes:
DerbyConnection
,HsqlConnection
,JdbcConnection
,MockDatabaseConnection
,OfflineConnection
,SybaseASAConnection
,SybaseConnection
public interface DatabaseConnection extends PrioritizedService, AutoCloseable
A liquibase abstraction over the normal Connection that is available in java.sql. This interface allows wrappers and aspects over the basic connection.
-
-
Field Summary
-
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
attached(Database database)
void
close()
void
commit()
boolean
getAutoCommit()
String
getCatalog()
String
getConnectionUserName()
int
getDatabaseMajorVersion()
int
getDatabaseMinorVersion()
String
getDatabaseProductName()
String
getDatabaseProductVersion()
String
getURL()
boolean
isClosed()
String
nativeSQL(String sql)
void
open(String url, Driver driverObject, Properties driverProperties)
void
rollback()
void
setAutoCommit(boolean autoCommit)
default boolean
supports(String url)
Default implementation for compatibility with a URL.-
Methods inherited from interface liquibase.servicelocator.PrioritizedService
getPriority
-
-
-
-
Method Detail
-
open
void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException
- Throws:
DatabaseException
-
supports
default boolean supports(String url)
Default implementation for compatibility with a URL. Method is used when a Connection is opened based on an identified driverObject from url. Can be overridden in DatabaseConnection implementations with a higher priority to check against a given url.- Parameters:
url
- the url connection string- Returns:
- true if URL is supported
-
close
void close() throws DatabaseException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
DatabaseException
-
commit
void commit() throws DatabaseException
- Throws:
DatabaseException
-
getAutoCommit
boolean getAutoCommit() throws DatabaseException
- Throws:
DatabaseException
-
getCatalog
String getCatalog() throws DatabaseException
- Throws:
DatabaseException
-
nativeSQL
String nativeSQL(String sql) throws DatabaseException
- Throws:
DatabaseException
-
rollback
void rollback() throws DatabaseException
- Throws:
DatabaseException
-
setAutoCommit
void setAutoCommit(boolean autoCommit) throws DatabaseException
- Throws:
DatabaseException
-
getDatabaseProductName
String getDatabaseProductName() throws DatabaseException
- Throws:
DatabaseException
-
getDatabaseProductVersion
String getDatabaseProductVersion() throws DatabaseException
- Throws:
DatabaseException
-
getDatabaseMajorVersion
int getDatabaseMajorVersion() throws DatabaseException
- Throws:
DatabaseException
-
getDatabaseMinorVersion
int getDatabaseMinorVersion() throws DatabaseException
- Throws:
DatabaseException
-
getURL
String getURL()
-
getConnectionUserName
String getConnectionUserName()
-
isClosed
boolean isClosed() throws DatabaseException
- Throws:
DatabaseException
-
attached
void attached(Database database)
-
-