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 TypeMethodDescriptionvoid
Clears the cached state.void
void
close()
Returns this instance to my containing pool.boolean
boolean
Gets whether to cache properties.int
Gets the value of theObject.toString()
method via a bean getter, so it can be read as a property via JMX.int
boolean
isClosed()
boolean
void
Closes the underlyingConnection
.void
setAutoCommit
(boolean autoCommit) void
setCacheState
(boolean cacheState) Sets whether to cache properties.void
setCatalog
(String catalog) void
setHoldability
(int holdability) void
setReadOnly
(boolean readOnly) void
void
setTransactionIsolation
(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)
.
-