Package org.apache.tomcat.dbcp.dbcp2
Interface PoolableConnectionMXBean
-
- All Known Implementing Classes:
PoolableConnection,PoolableManagedConnection
public interface PoolableConnectionMXBeanDefines the attributes and methods that will be exposed via JMX forPoolableConnectioninstances.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearCachedState()Clears the cached state.voidclearWarnings()SeeConnection.clearWarnings().voidclose()Returns this instance to my containing pool.booleangetAutoCommit()SeeConnection.getAutoCommit().booleangetCacheState()Gets whether to cache properties.java.lang.StringgetCatalog()SeeConnection.getCatalog().intgetHoldability()SeeConnection.getHoldability().java.lang.StringgetSchema()SeeConnection.getSchema().java.lang.StringgetToString()Gets the value of theObject.toString()method via a bean getter, so it can be read as a property via JMX.intgetTransactionIsolation()SeeConnection.getTransactionIsolation().booleanisClosed()SeeConnection.isClosed().booleanisReadOnly()SeeConnection.isReadOnly().voidreallyClose()Closes the underlyingConnection.voidsetAutoCommit(boolean autoCommit)SeeConnection.setAutoCommit(boolean).voidsetCacheState(boolean cacheState)Sets whether to cache properties.voidsetCatalog(java.lang.String catalog)SeeConnection.setCatalog(String).voidsetHoldability(int holdability)SeeConnection.setHoldability(int).voidsetReadOnly(boolean readOnly)SeeConnection.setReadOnly(boolean).voidsetSchema(java.lang.String schema)SeeConnection.setSchema(String).voidsetTransactionIsolation(int level)SeeConnection.setTransactionIsolation(int).
-
-
-
Method Detail
-
clearCachedState
void clearCachedState()
Clears the cached state. Call when you know that the underlying connection may have been accessed directly.
-
clearWarnings
void clearWarnings() throws java.sql.SQLExceptionSeeConnection.clearWarnings().- Throws:
java.sql.SQLException- SeeConnection.clearWarnings().
-
close
void close() throws java.sql.SQLExceptionReturns this instance to my containing pool.- Throws:
java.sql.SQLException- Throw if this instance cannot be returned.
-
getAutoCommit
boolean getAutoCommit() throws java.sql.SQLExceptionSeeConnection.getAutoCommit().- Returns:
- See
Connection.getAutoCommit(). - Throws:
java.sql.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
java.lang.String getCatalog() throws java.sql.SQLExceptionSeeConnection.getCatalog().- Returns:
- See
Connection.getCatalog(). - Throws:
java.sql.SQLException- SeeConnection.getCatalog().
-
getHoldability
int getHoldability() throws java.sql.SQLExceptionSeeConnection.getHoldability().- Returns:
- See
Connection.getHoldability(). - Throws:
java.sql.SQLException- SeeConnection.getHoldability().
-
getSchema
java.lang.String getSchema() throws java.sql.SQLExceptionSeeConnection.getSchema().- Returns:
- See
Connection.getSchema(). - Throws:
java.sql.SQLException- SeeConnection.getSchema().
-
getToString
java.lang.String 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
int getTransactionIsolation() throws java.sql.SQLExceptionSeeConnection.getTransactionIsolation().- Returns:
- See
Connection.getTransactionIsolation(). - Throws:
java.sql.SQLException- SeeConnection.getTransactionIsolation().
-
isClosed
boolean isClosed() throws java.sql.SQLExceptionSeeConnection.isClosed().- Returns:
- See
Connection.isClosed(). - Throws:
java.sql.SQLException- SeeConnection.isClosed().
-
isReadOnly
boolean isReadOnly() throws java.sql.SQLExceptionSeeConnection.isReadOnly().- Returns:
- See
Connection.isReadOnly(). - Throws:
java.sql.SQLException- SeeConnection.isReadOnly().
-
reallyClose
void reallyClose() throws java.sql.SQLExceptionCloses the underlyingConnection.- Throws:
java.sql.SQLException- Thrown if the connection can be closed.
-
setAutoCommit
void setAutoCommit(boolean autoCommit) throws java.sql.SQLExceptionSeeConnection.setAutoCommit(boolean).- Parameters:
autoCommit- SeeConnection.setAutoCommit(boolean).- Throws:
java.sql.SQLException- SeeConnection.setAutoCommit(boolean).
-
setCacheState
void setCacheState(boolean cacheState)
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
void setCatalog(java.lang.String catalog) throws java.sql.SQLExceptionSeeConnection.setCatalog(String).- Parameters:
catalog- SeeConnection.setCatalog(String).- Throws:
java.sql.SQLException- SeeConnection.setCatalog(String).
-
setHoldability
void setHoldability(int holdability) throws java.sql.SQLExceptionSeeConnection.setHoldability(int).- Parameters:
holdability-Connection.setHoldability(int).- Throws:
java.sql.SQLException- SeeConnection.setHoldability(int).
-
setReadOnly
void setReadOnly(boolean readOnly) throws java.sql.SQLExceptionSeeConnection.setReadOnly(boolean).- Parameters:
readOnly- SeeConnection.setReadOnly(boolean).- Throws:
java.sql.SQLException- SeeConnection.setReadOnly(boolean).
-
setSchema
void setSchema(java.lang.String schema) throws java.sql.SQLExceptionSeeConnection.setSchema(String).- Parameters:
schema- SeeConnection.setSchema(String).- Throws:
java.sql.SQLException- SeeConnection.setSchema(String).
-
setTransactionIsolation
void setTransactionIsolation(int level) throws java.sql.SQLExceptionSeeConnection.setTransactionIsolation(int).- Parameters:
level- SeeConnection.setTransactionIsolation(int).- Throws:
java.sql.SQLException- SeeConnection.setTransactionIsolation(int).
-
-