C - the Connection typepublic class ManagedConnection<C extends java.sql.Connection> extends DelegatingConnection<C>
| Constructor and Description |
|---|
ManagedConnection(org.apache.commons.pool2.ObjectPool<C> pool,
TransactionRegistry transactionRegistry,
boolean accessToUnderlyingConnectionAllowed) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying connection, and close any Statements that were not
explicitly closed.
|
void |
commit() |
C |
getDelegate()
Returns my underlying
Connection. |
java.sql.Connection |
getInnermostDelegate()
If my underlying
Connection is not a
DelegatingConnection, returns it,
otherwise recursively invokes this method on
my delegate. |
boolean |
isAccessToUnderlyingConnectionAllowed()
If false, getDelegate() and getInnermostDelegate() will return null.
|
void |
rollback() |
void |
setAutoCommit(boolean autoCommit) |
void |
setReadOnly(boolean readOnly) |
abort, clearCachedState, clearWarnings, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCacheState, getCatalog, getClientInfo, getClientInfo, getDefaultQueryTimeout, getHoldability, getInnermostDelegateInternal, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, innermostDelegateEquals, isClosed, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setCacheState, setCatalog, setClientInfo, setClientInfo, setDefaultQueryTimeout, setDelegate, setHoldability, setNetworkTimeout, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, toString, unwrapgetLastUsedpublic ManagedConnection(org.apache.commons.pool2.ObjectPool<C> pool, TransactionRegistry transactionRegistry, boolean accessToUnderlyingConnectionAllowed) throws java.sql.SQLException
java.sql.SQLExceptionpublic void close()
throws java.sql.SQLException
DelegatingConnectionfalseclose in interface java.lang.AutoCloseableclose in interface java.sql.Connectionclose in class DelegatingConnection<C extends java.sql.Connection>java.sql.SQLExceptionpublic void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectioncommit in class DelegatingConnection<C extends java.sql.Connection>java.sql.SQLExceptionpublic C getDelegate()
DelegatingConnectionConnection.getDelegate in class DelegatingConnection<C extends java.sql.Connection>Connection.public java.sql.Connection getInnermostDelegate()
DelegatingConnectionConnection is not a
DelegatingConnection, returns it,
otherwise recursively invokes this method on
my delegate.
Hence this method will return the first
delegate that is not a DelegatingConnection,
or null when no non-DelegatingConnection
delegate can be found by traversing this chain.
This method is useful when you may have nested
DelegatingConnections, and you want to make
sure to obtain a "genuine" Connection.
getInnermostDelegate in class DelegatingConnection<C extends java.sql.Connection>public boolean isAccessToUnderlyingConnectionAllowed()
public void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionrollback in class DelegatingConnection<C extends java.sql.Connection>java.sql.SQLExceptionpublic void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
setAutoCommit in interface java.sql.ConnectionsetAutoCommit in class DelegatingConnection<C extends java.sql.Connection>java.sql.SQLExceptionpublic void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.ConnectionsetReadOnly in class DelegatingConnection<C extends java.sql.Connection>java.sql.SQLExceptionCopyright © 2001-2015 Apache Software Foundation. Documenation generated October 5 2016.