Package liquibase.database.jvm
Class JdbcConnection
java.lang.Object
liquibase.database.jvm.JdbcConnection
- All Implemented Interfaces:
AutoCloseable
,DatabaseConnection
,PrioritizedService
- Direct Known Subclasses:
DerbyConnection
,HsqlConnection
,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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
close()
void
commit()
createStatement
(int resultSetType, int resultSetConcurrency) createStatement
(int resultSetType, int resultSetConcurrency, int resultSetHoldability) boolean
boolean
protected String
int
int
int
int
int
getURL()
Returns the connection that this Delegate is using.int
hashCode()
boolean
isClosed()
boolean
void
open
(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) void
releaseSavepoint
(Savepoint savepoint) void
rollback()
void
static String
sanitizeUrl
(String url) Remove any secure information from the URL.void
setAutoCommit
(boolean autoCommit) void
setCatalog
(String catalog) void
setHoldability
(int holdability) void
setReadOnly
(boolean readOnly) setSavepoint
(String name) void
setTransactionIsolation
(int level) void
setTypeMap
(Map<String, Class<?>> map) boolean
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface liquibase.database.DatabaseConnection
supports
-
Constructor Details
-
JdbcConnection
public JdbcConnection() -
JdbcConnection
-
-
Method Details
-
getPriority
public int getPriority()- Specified by:
getPriority
in interfacePrioritizedService
-
open
public void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException - Specified by:
open
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
attached
- Specified by:
attached
in interfaceDatabaseConnection
-
getDatabaseProductName
- Specified by:
getDatabaseProductName
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getDatabaseProductVersion
- Specified by:
getDatabaseProductVersion
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getDatabaseMajorVersion
- Specified by:
getDatabaseMajorVersion
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getDatabaseMinorVersion
- Specified by:
getDatabaseMinorVersion
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getURL
- Specified by:
getURL
in interfaceDatabaseConnection
-
sanitizeUrl
Remove any secure information from the URL. Used for logging purposes Strips off the;password=
property from string. Note: it does not remove the password from theuser:password@host
section- Parameters:
url
- string to remove password=xxx from- Returns:
- modified string
-
getConnectionUrl
- Throws:
SQLException
-
getConnectionUserName
- Specified by:
getConnectionUserName
in interfaceDatabaseConnection
-
getWrappedConnection
Returns the connection that this Delegate is using.- Returns:
- The connection originally passed in the constructor
-
clearWarnings
- Throws:
DatabaseException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
commit
- Specified by:
commit
in 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:
getAutoCommit
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getCatalog
- Specified by:
getCatalog
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getHoldability
- Throws:
DatabaseException
-
getMetaData
- Throws:
DatabaseException
-
getTransactionIsolation
- Throws:
DatabaseException
-
getTypeMap
- Throws:
DatabaseException
-
getWarnings
- Throws:
DatabaseException
-
isClosed
- Specified by:
isClosed
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
isReadOnly
- Throws:
DatabaseException
-
nativeSQL
- Specified by:
nativeSQL
in 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:
rollback
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
rollback
- Throws:
DatabaseException
-
setAutoCommit
- Specified by:
setAutoCommit
in 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
-
equals
-
hashCode
public int hashCode() -
supportsBatchUpdates
- Throws:
DatabaseException
-