Top Description Fields Constructors Methods
liquibase.database.jvm

public Class JdbcConnection

extends Object
implements DatabaseConnection
Class Inheritance
All Implemented Interfaces
liquibase.database.DatabaseConnection, java.lang.AutoCloseable, liquibase.servicelocator.PrioritizedService
Known Direct Subclasses
liquibase.database.jvm.SybaseASAConnection, liquibase.database.jvm.SybaseConnection, liquibase.database.jvm.DerbyConnection, liquibase.database.jvm.HsqlConnection
Imports
liquibase.Scope, liquibase.database.Database, .DatabaseConnection, liquibase.exception.DatabaseException, .UnexpectedLiquibaseException, java.sql.*, java.util.*, java.util.regex.Matcher, .Pattern

A ConnectionWrapper implementation which delegates completely to an underlying java.sql.connection.

Field Summary

Modifier and TypeField and Description
private Connection
private static final List<ConnectionPatterns>
private static final Pattern

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
close()

Implements liquibase.database.DatabaseConnection.close.

Closes this resource, relinquishing any underlying resources.

public void
public Statement
public Statement
createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)

public Statement
createStatement(int resultSetType, int resultSetConcurrency)

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public boolean
public String
protected String
public String
public int
public int
public String
public String
public int
public DatabaseMetaData
public int
public int
public Map<String, Class<?>>
public Connection
public String
public SQLWarning
public Connection

Returns:

The connection originally passed in the constructor
getWrappedConnection
()

Returns the connection that this Delegate is using.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
public boolean
public String
private static String
public void
open(String url, Driver driverObject, Properties driverProperties)

Implements liquibase.database.DatabaseConnection.open.

public CallableStatement
prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

public CallableStatement
prepareCall(String sql, int resultSetType, int resultSetConcurrency)

public CallableStatement
public PreparedStatement
prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

public PreparedStatement
prepareStatement(String sql, int resultSetType, int resultSetConcurrency)

public PreparedStatement
prepareStatement(String sql, int autoGeneratedKeys)

public PreparedStatement
prepareStatement(String sql, int[] columnIndexes)

public PreparedStatement
prepareStatement(String sql, String[] columnNames)

public PreparedStatement
public void
public void
public void
rollback(Savepoint savepoint)

public static String

Returns:

modified string
sanitizeUrl
(String
string to remove password=xxx from
url
)

Remove any secure information from the URL.

public void
public void
setCatalog(String catalog)

public void
setHoldability(int holdability)

public void
setReadOnly(boolean readOnly)

public Savepoint
public Savepoint
public void
public void
private static String
public boolean
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

conback to summary
private Connection con
JDBC_CONNECTION_PATTERNSback to summary
private static final List<ConnectionPatterns> JDBC_CONNECTION_PATTERNS
PROXY_USERback to summary
private static final Pattern PROXY_USER

Constructor Detail

JdbcConnectionback to summary
public JdbcConnection()
JdbcConnectionback to summary
public JdbcConnection(Connection connection)

Method Detail

attachedback to summary
public void attached(Database database)

Implements liquibase.database.DatabaseConnection.attached.

Annotations
@Override
clearWarningsback to summary
public void clearWarnings() throws DatabaseException
closeback to summary
public void close() throws DatabaseException

Implements liquibase.database.DatabaseConnection.close.

Doc from java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Annotations
@Override
commitback to summary
public void commit() throws DatabaseException

Implements liquibase.database.DatabaseConnection.commit.

Annotations
@Override
createStatementback to summary
public Statement createStatement() throws DatabaseException
createStatementback to summary
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws DatabaseException
createStatementback to summary
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws DatabaseException
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAutoCommitback to summary
public boolean getAutoCommit() throws DatabaseException

Implements liquibase.database.DatabaseConnection.getAutoCommit.

Annotations
@Override
getCatalogback to summary
public String getCatalog() throws DatabaseException

Implements liquibase.database.DatabaseConnection.getCatalog.

Annotations
@Override
getConnectionUrlback to summary
protected String getConnectionUrl() throws SQLException
getConnectionUserNameback to summary
public String getConnectionUserName()

Implements liquibase.database.DatabaseConnection.getConnectionUserName.

Annotations
@Override
getDatabaseMajorVersionback to summary
public int getDatabaseMajorVersion() throws DatabaseException

Implements liquibase.database.DatabaseConnection.getDatabaseMajorVersion.

Annotations
@Override
getDatabaseMinorVersionback to summary
public int getDatabaseMinorVersion() throws DatabaseException

Implements liquibase.database.DatabaseConnection.getDatabaseMinorVersion.

Annotations
@Override
getDatabaseProductNameback to summary
public String getDatabaseProductName() throws DatabaseException

Implements liquibase.database.DatabaseConnection.getDatabaseProductName.

Annotations
@Override
getDatabaseProductVersionback to summary
public String getDatabaseProductVersion() throws DatabaseException

Implements liquibase.database.DatabaseConnection.getDatabaseProductVersion.

Annotations
@Override
getHoldabilityback to summary
public int getHoldability() throws DatabaseException
getMetaDataback to summary
public DatabaseMetaData getMetaData() throws DatabaseException
getPriorityback to summary
public int getPriority()

Implements liquibase.servicelocator.PrioritizedService.getPriority.

Annotations
@Override
getTransactionIsolationback to summary
public int getTransactionIsolation() throws DatabaseException
getTypeMapback to summary
public Map<String, Class<?>> getTypeMap() throws DatabaseException
getUnderlyingConnectionback to summary
public Connection getUnderlyingConnection()
getURLback to summary
public String getURL()

Implements liquibase.database.DatabaseConnection.getURL.

Annotations
@Override
getWarningsback to summary
public SQLWarning getWarnings() throws DatabaseException
getWrappedConnectionback to summary
public Connection getWrappedConnection()

Returns the connection that this Delegate is using.

Returns:Connection

The connection originally passed in the constructor

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isClosedback to summary
public boolean isClosed() throws DatabaseException

Implements liquibase.database.DatabaseConnection.isClosed.

Annotations
@Override
isReadOnlyback to summary
public boolean isReadOnly() throws DatabaseException
nativeSQLback to summary
public String nativeSQL(String sql) throws DatabaseException

Implements liquibase.database.DatabaseConnection.nativeSQL.

Annotations
@Override
obfuscateCredentialsPropFromJdbcUrlback to summary
private static String obfuscateCredentialsPropFromJdbcUrl(String jdbcUrl)
openback to summary
public void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException

Implements liquibase.database.DatabaseConnection.open.

Annotations
@Override
prepareCallback to summary
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws DatabaseException
prepareCallback to summary
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws DatabaseException
prepareCallback to summary
public CallableStatement prepareCall(String sql) throws DatabaseException
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws DatabaseException
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws DatabaseException
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws DatabaseException
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws DatabaseException
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws DatabaseException
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql) throws DatabaseException
releaseSavepointback to summary
public void releaseSavepoint(Savepoint savepoint) throws DatabaseException
rollbackback to summary
public void rollback() throws DatabaseException

Implements liquibase.database.DatabaseConnection.rollback.

Annotations
@Override
rollbackback to summary
public void rollback(Savepoint savepoint) throws DatabaseException
sanitizeUrlback to summary
public static String sanitizeUrl(String url)

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 the user:password@host section

Parameters
url:String

string to remove password=xxx from

Returns:String

modified string

setAutoCommitback to summary
public void setAutoCommit(boolean autoCommit) throws DatabaseException

Implements liquibase.database.DatabaseConnection.setAutoCommit.

Annotations
@Override
setCatalogback to summary
public void setCatalog(String catalog) throws DatabaseException
setHoldabilityback to summary
public void setHoldability(int holdability) throws DatabaseException
setReadOnlyback to summary
public void setReadOnly(boolean readOnly) throws DatabaseException
setSavepointback to summary
public Savepoint setSavepoint() throws DatabaseException
setSavepointback to summary
public Savepoint setSavepoint(String name) throws DatabaseException
setTransactionIsolationback to summary
public void setTransactionIsolation(int level) throws DatabaseException
setTypeMapback to summary
public void setTypeMap(Map<String, Class<?>> map) throws DatabaseException
stripPasswordPropFromJdbcUrlback to summary
private static String stripPasswordPropFromJdbcUrl(String jdbcUrl)
supportsBatchUpdatesback to summary
public boolean supportsBatchUpdates() throws DatabaseException