public class JdbcConnection extends Object implements DatabaseConnection
Modifier and Type | Field and Description |
---|---|
static String |
FILTER_CREDS |
static String |
FILTER_CREDS_MYSQL_TO_OBFUSCATE |
static String |
FILTER_CREDS_ORACLE_TO_OBFUSCATE |
static String |
FILTER_CREDS_PASSWORD |
static String |
FILTER_CREDS_PRIVATE_KEY_FILE |
static String |
FILTER_CREDS_PRIVATE_KEY_FILE_PWD |
static String |
FILTER_CREDS_PRIVATE_KEY_TO_BLANK |
static String |
FILTER_CREDS_USER |
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
Constructor and Description |
---|
JdbcConnection() |
JdbcConnection(Connection connection) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
supports
public static final String FILTER_CREDS_PRIVATE_KEY_TO_BLANK
public static final String FILTER_CREDS_PASSWORD
public static final String FILTER_CREDS_USER
public static final String FILTER_CREDS_PRIVATE_KEY_FILE
public static final String FILTER_CREDS_PRIVATE_KEY_FILE_PWD
public static final String FILTER_CREDS
public static final String FILTER_CREDS_MYSQL_TO_OBFUSCATE
public static final String FILTER_CREDS_ORACLE_TO_OBFUSCATE
public JdbcConnection()
public JdbcConnection(Connection connection)
public int getPriority()
getPriority
in interface PrioritizedService
public void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException
open
in interface DatabaseConnection
DatabaseException
public void attached(Database database)
attached
in interface DatabaseConnection
public String getDatabaseProductName() throws DatabaseException
getDatabaseProductName
in interface DatabaseConnection
DatabaseException
public String getDatabaseProductVersion() throws DatabaseException
getDatabaseProductVersion
in interface DatabaseConnection
DatabaseException
public int getDatabaseMajorVersion() throws DatabaseException
getDatabaseMajorVersion
in interface DatabaseConnection
DatabaseException
public int getDatabaseMinorVersion() throws DatabaseException
getDatabaseMinorVersion
in interface DatabaseConnection
DatabaseException
public String getURL()
getURL
in interface DatabaseConnection
public static String sanitizeUrl(String url)
;password=
property from string.
Note: it does not remove the password from the
user:password@host
sectionurl
- string to remove password=xxx fromprotected String getConnectionUrl() throws SQLException
SQLException
public String getConnectionUserName()
getConnectionUserName
in interface DatabaseConnection
public Connection getWrappedConnection()
public void clearWarnings() throws DatabaseException
DatabaseException
public void close() throws DatabaseException
close
in interface AutoCloseable
close
in interface DatabaseConnection
DatabaseException
public void commit() throws DatabaseException
commit
in interface DatabaseConnection
DatabaseException
public Statement createStatement() throws DatabaseException
DatabaseException
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws DatabaseException
DatabaseException
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws DatabaseException
DatabaseException
public boolean getAutoCommit() throws DatabaseException
getAutoCommit
in interface DatabaseConnection
DatabaseException
public String getCatalog() throws DatabaseException
getCatalog
in interface DatabaseConnection
DatabaseException
public int getHoldability() throws DatabaseException
DatabaseException
public DatabaseMetaData getMetaData() throws DatabaseException
DatabaseException
public int getTransactionIsolation() throws DatabaseException
DatabaseException
public Map<String,Class<?>> getTypeMap() throws DatabaseException
DatabaseException
public SQLWarning getWarnings() throws DatabaseException
DatabaseException
public boolean isClosed() throws DatabaseException
isClosed
in interface DatabaseConnection
DatabaseException
public boolean isReadOnly() throws DatabaseException
DatabaseException
public String nativeSQL(String sql) throws DatabaseException
nativeSQL
in interface DatabaseConnection
DatabaseException
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws DatabaseException
DatabaseException
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws DatabaseException
DatabaseException
public CallableStatement prepareCall(String sql) throws DatabaseException
DatabaseException
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws DatabaseException
DatabaseException
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws DatabaseException
DatabaseException
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws DatabaseException
DatabaseException
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws DatabaseException
DatabaseException
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws DatabaseException
DatabaseException
public PreparedStatement prepareStatement(String sql) throws DatabaseException
DatabaseException
public void releaseSavepoint(Savepoint savepoint) throws DatabaseException
DatabaseException
public void rollback() throws DatabaseException
rollback
in interface DatabaseConnection
DatabaseException
public void rollback(Savepoint savepoint) throws DatabaseException
DatabaseException
public void setAutoCommit(boolean autoCommit) throws DatabaseException
setAutoCommit
in interface DatabaseConnection
DatabaseException
public void setCatalog(String catalog) throws DatabaseException
DatabaseException
public void setHoldability(int holdability) throws DatabaseException
DatabaseException
public void setReadOnly(boolean readOnly) throws DatabaseException
DatabaseException
public Savepoint setSavepoint() throws DatabaseException
DatabaseException
public Savepoint setSavepoint(String name) throws DatabaseException
DatabaseException
public void setTransactionIsolation(int level) throws DatabaseException
DatabaseException
public void setTypeMap(Map<String,Class<?>> map) throws DatabaseException
DatabaseException
public Connection getUnderlyingConnection()
public boolean supportsBatchUpdates() throws DatabaseException
DatabaseException
Copyright © 2023 Liquibase.org. All rights reserved.