Package org.apache.commons.dbcp2
Interface PoolableConnectionMXBean
- All Known Implementing Classes:
PoolableConnection,PoolableManagedConnection
public interface PoolableConnectionMXBean
Defines the attributes and methods that will be exposed via JMX for
PoolableConnection instances.- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidClears the cached state.voidvoidclose()Returns this instance to my containing pool.booleanbooleanGets whether to cache properties.intGets the value of theObject.toString()method via a bean getter, so it can be read as a property via JMX.intbooleanisClosed()booleanvoidCloses the underlyingConnection.voidsetAutoCommit(boolean autoCommit) voidsetCacheState(boolean cacheState) Sets whether to cache properties.voidsetCatalog(String catalog) voidsetHoldability(int holdability) voidsetReadOnly(boolean readOnly) voidvoidsetTransactionIsolation(int level)
-
Method Details
-
clearCachedState
void clearCachedState()Clears the cached state. Call when you know that the underlying connection may have been accessed directly. -
clearWarnings
- Throws:
SQLException- SeeConnection.clearWarnings().
-
close
Returns this instance to my containing pool.- Throws:
SQLException- Throw if this instance cannot be returned.
-
getAutoCommit
- Returns:
- See
Connection.getAutoCommit(). - Throws:
SQLException- SeeConnection.getAutoCommit().
-
getCacheState
boolean getCacheState()Gets whether to cache properties. The cached properties are:- auto-commit
- catalog
- schema
- read-only
- Returns:
- The value for the state caching flag.
-
getCatalog
- Returns:
- See
Connection.getCatalog(). - Throws:
SQLException- SeeConnection.getCatalog().
-
getHoldability
- Returns:
- See
Connection.getHoldability(). - Throws:
SQLException- SeeConnection.getHoldability().
-
getSchema
- Returns:
- See
Connection.getSchema(). - Throws:
SQLException- SeeConnection.getSchema().
-
getToString
Gets the value of theObject.toString()method via a bean getter, so it can be read as a property via JMX.- Returns:
- the value of the
Object.toString().
-
getTransactionIsolation
- Returns:
- See
Connection.getTransactionIsolation(). - Throws:
SQLException- SeeConnection.getTransactionIsolation().
-
isClosed
- Returns:
- See
Connection.isClosed(). - Throws:
SQLException- SeeConnection.isClosed().
-
isReadOnly
- Returns:
- See
Connection.isReadOnly(). - Throws:
SQLException- SeeConnection.isReadOnly().
-
reallyClose
Closes the underlyingConnection.- Throws:
SQLException- Thrown if the connection can be closed.
-
setAutoCommit
- Parameters:
autoCommit- SeeConnection.setAutoCommit(boolean).- Throws:
SQLException- SeeConnection.setAutoCommit(boolean).
-
setCacheState
Sets whether to cache properties. The cached properties are:- auto-commit
- catalog
- schema
- read-only
- Parameters:
cacheState- The new value for the state caching flag
-
setCatalog
- Parameters:
catalog- SeeConnection.setCatalog(String).- Throws:
SQLException- SeeConnection.setCatalog(String).
-
setHoldability
- Parameters:
holdability-Connection.setHoldability(int).- Throws:
SQLException- SeeConnection.setHoldability(int).
-
setReadOnly
- Parameters:
readOnly- SeeConnection.setReadOnly(boolean).- Throws:
SQLException- SeeConnection.setReadOnly(boolean).
-
setSchema
- Parameters:
schema- SeeConnection.setSchema(String).- Throws:
SQLException- SeeConnection.setSchema(String).
-
setTransactionIsolation
- Parameters:
level- SeeConnection.setTransactionIsolation(int).- Throws:
SQLException- SeeConnection.setTransactionIsolation(int).
-