public class ManagedConnection extends DelegatingConnection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Constructor and Description |
|---|
ManagedConnection(ObjectPool 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() |
Connection |
getDelegate()
Returns my underlying
Connection. |
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, clearWarnings, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, equals, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, hashCode, innermostDelegateEquals, isClosed, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setCatalog, setClientInfo, setClientInfo, setDelegate, setHoldability, setNetworkTimeout, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, toString, unwrapprintStackTracepublic ManagedConnection(ObjectPool pool, TransactionRegistry transactionRegistry, boolean accessToUnderlyingConnectionAllowed) throws SQLException
SQLExceptionpublic void close()
throws SQLException
DelegatingConnectionclose in interface AutoCloseableclose in interface Connectionclose in class DelegatingConnectionSQLExceptionpublic void commit()
throws SQLException
commit in interface Connectioncommit in class DelegatingConnectionSQLExceptionpublic Connection getDelegate()
DelegatingConnectionConnection.getDelegate in class DelegatingConnectionConnection.public 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 DelegatingConnectionpublic boolean isAccessToUnderlyingConnectionAllowed()
public void rollback()
throws SQLException
rollback in interface Connectionrollback in class DelegatingConnectionSQLExceptionpublic void setAutoCommit(boolean autoCommit)
throws SQLException
setAutoCommit in interface ConnectionsetAutoCommit in class DelegatingConnectionSQLExceptionpublic void setReadOnly(boolean readOnly)
throws SQLException
setReadOnly in interface ConnectionsetReadOnly in class DelegatingConnectionSQLExceptionCopyright © 2001-2004 Apache Software Foundation. Documenation generated July 9 2012.