public class PoolableConnection extends DelegatingConnection<Connection> implements PoolableConnectionMXBean
ObjectPool
when
closed.TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
Constructor and Description |
---|
PoolableConnection(Connection conn,
ObjectPool<PoolableConnection> pool,
ObjectName jmxName) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Returns me to my pool.
|
String |
getToString()
Expose the
DelegatingConnection.toString() method via a bean getter so it can be read
as a property via JMX. |
boolean |
isClosed() |
protected void |
passivate() |
void |
reallyClose()
Actually close my underlying
Connection . |
void |
validate(String sql,
int timeout) |
abort, activate, checkOpen, clearCachedState, clearWarnings, closeInternal, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCacheState, getCatalog, getClientInfo, getClientInfo, getDefaultQueryTimeout, getDelegate, getDelegateInternal, getHoldability, getInnermostDelegate, getInnermostDelegateInternal, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, handleException, innermostDelegateEquals, isClosedInternal, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCacheState, setCatalog, setClientInfo, setClientInfo, setClosedInternal, setDefaultQueryTimeout, setDelegate, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, toString, unwrap
addTrace, clearTrace, getLastUsed, getTrace, removeTrace, setLastUsed, setLastUsed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearCachedState, clearWarnings, getAutoCommit, getCacheState, getCatalog, getHoldability, getSchema, getTransactionIsolation, isReadOnly, setAutoCommit, setCacheState, setCatalog, setHoldability, setReadOnly, setSchema, setTransactionIsolation
public PoolableConnection(Connection conn, ObjectPool<PoolableConnection> pool, ObjectName jmxName)
conn
- my underlying connectionpool
- the pool to which I should return when closedprotected void passivate() throws SQLException
passivate
in class DelegatingConnection<Connection>
SQLException
public boolean isClosed() throws SQLException
This method should not be used by a client to determine whether or not a
connection should be return to the connection pool (by calling
close()
). Clients should always attempt to return a connection
to the pool once it is no longer required.
isClosed
in interface Connection
isClosed
in interface PoolableConnectionMXBean
isClosed
in class DelegatingConnection<Connection>
SQLException
public void close() throws SQLException
close
in interface AutoCloseable
close
in interface Connection
close
in interface PoolableConnectionMXBean
close
in class DelegatingConnection<Connection>
SQLException
public void reallyClose() throws SQLException
Connection
.reallyClose
in interface PoolableConnectionMXBean
SQLException
public String getToString()
DelegatingConnection.toString()
method via a bean getter so it can be read
as a property via JMX.getToString
in interface PoolableConnectionMXBean
public void validate(String sql, int timeout) throws SQLException
SQLException
Copyright © 2001–2014 The Apache Software Foundation. All rights reserved.