Package liquibase.database.jvm
Class JdbcConnection
java.lang.Object
liquibase.database.jvm.JdbcConnection
- All Implemented Interfaces:
AutoCloseable,DatabaseConnection,PrioritizedService
- Direct Known Subclasses:
DerbyConnection,HsqlConnection,SnowflakeJdbcConnection,SybaseASAConnection,SybaseConnection
A ConnectionWrapper implementation which delegates completely to an
underlying java.sql.connection.
-
Field Summary
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidclose()voidcommit()createStatement(int resultSetType, int resultSetConcurrency) createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) booleanbooleanprotected StringintintintintintgetURL()Returns the connection that this Delegate is using.inthashCode()booleanisClosed()booleanvoidopen(String url, Driver driverObject, Properties driverProperties) prepareCall(String sql) prepareCall(String sql, int resultSetType, int resultSetConcurrency) prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement(String sql) prepareStatement(String sql, int autoGeneratedKeys) prepareStatement(String sql, int[] columnIndexes) prepareStatement(String sql, int resultSetType, int resultSetConcurrency) prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement(String sql, String[] columnNames) voidreleaseSavepoint(Savepoint savepoint) voidrollback()voidstatic StringsanitizeUrl(String url) Remove any secure information from the URL.static StringsanitizeUrl(String url, boolean replaceWithEmpty) Remove any secure information from the URL.voidsetAutoCommit(boolean autoCommit) voidsetCatalog(String catalog) voidsetHoldability(int holdability) voidsetReadOnly(boolean readOnly) setSavepoint(String name) voidsetTransactionIsolation(int level) voidsetTypeMap(Map<String, Class<?>> map) booleanMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface liquibase.database.DatabaseConnection
getVisibleUrl, supports
-
Constructor Details
-
JdbcConnection
public JdbcConnection() -
JdbcConnection
-
-
Method Details
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfacePrioritizedService
-
open
public void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException - Specified by:
openin interfaceDatabaseConnection- Throws:
DatabaseException
-
attached
- Specified by:
attachedin interfaceDatabaseConnection
-
getDatabaseProductName
- Specified by:
getDatabaseProductNamein interfaceDatabaseConnection- Throws:
DatabaseException
-
getDatabaseProductVersion
- Specified by:
getDatabaseProductVersionin interfaceDatabaseConnection- Throws:
DatabaseException
-
getDatabaseMajorVersion
- Specified by:
getDatabaseMajorVersionin interfaceDatabaseConnection- Throws:
DatabaseException
-
getDatabaseMinorVersion
- Specified by:
getDatabaseMinorVersionin interfaceDatabaseConnection- Throws:
DatabaseException
-
getURL
- Specified by:
getURLin interfaceDatabaseConnection
-
sanitizeUrl
Remove any secure information from the URL. Used for logging purposes Strips off the;password=property from string.- Parameters:
url- string to remove password=xxx from- Returns:
- modified string
-
sanitizeUrl
Remove any secure information from the URL. Used for logging purposes Strips off the;password=property from string.- Parameters:
url- string to remove password=xxx fromreplaceWithEmpty- if true, the entire username and password string will be completely removed. If false, the username and password will be obfuscated with asterisks. Note that this is only partially implemented, and is only supporting usernames and passwords in the host part of the URL.- Returns:
- modified string
-
getConnectionUrl
- Throws:
SQLException
-
getConnectionUserName
- Specified by:
getConnectionUserNamein interfaceDatabaseConnection
-
getWrappedConnection
Returns the connection that this Delegate is using.- Returns:
- The connection originally passed in the constructor
-
clearWarnings
- Throws:
DatabaseException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceDatabaseConnection- Throws:
DatabaseException
-
commit
- Specified by:
commitin interfaceDatabaseConnection- Throws:
DatabaseException
-
createStatement
- Throws:
DatabaseException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws DatabaseException - Throws:
DatabaseException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws DatabaseException - Throws:
DatabaseException
-
getAutoCommit
- Specified by:
getAutoCommitin interfaceDatabaseConnection- Throws:
DatabaseException
-
getCatalog
- Specified by:
getCatalogin interfaceDatabaseConnection- Throws:
DatabaseException
-
getHoldability
- Throws:
DatabaseException
-
getMetaData
- Throws:
DatabaseException
-
getTransactionIsolation
- Throws:
DatabaseException
-
getTypeMap
- Throws:
DatabaseException
-
getWarnings
- Throws:
DatabaseException
-
isClosed
- Specified by:
isClosedin interfaceDatabaseConnection- Throws:
DatabaseException
-
isReadOnly
- Throws:
DatabaseException
-
nativeSQL
- Specified by:
nativeSQLin interfaceDatabaseConnection- Throws:
DatabaseException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws DatabaseException - Throws:
DatabaseException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws DatabaseException - Throws:
DatabaseException
-
prepareCall
- Throws:
DatabaseException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws DatabaseException - Throws:
DatabaseException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws DatabaseException - Throws:
DatabaseException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws DatabaseException - Throws:
DatabaseException
-
prepareStatement
- Throws:
DatabaseException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws DatabaseException - Throws:
DatabaseException
-
prepareStatement
- Throws:
DatabaseException
-
releaseSavepoint
- Throws:
DatabaseException
-
rollback
- Specified by:
rollbackin interfaceDatabaseConnection- Throws:
DatabaseException
-
rollback
- Throws:
DatabaseException
-
setAutoCommit
- Specified by:
setAutoCommitin interfaceDatabaseConnection- Throws:
DatabaseException
-
setCatalog
- Throws:
DatabaseException
-
setHoldability
- Throws:
DatabaseException
-
setReadOnly
- Throws:
DatabaseException
-
setSavepoint
- Throws:
DatabaseException
-
setSavepoint
- Throws:
DatabaseException
-
setTransactionIsolation
- Throws:
DatabaseException
-
setTypeMap
- Throws:
DatabaseException
-
getUnderlyingConnection
- Specified by:
getUnderlyingConnectionin interfaceDatabaseConnection
-
equals
-
hashCode
public int hashCode() -
supportsBatchUpdates
- Throws:
DatabaseException
-