Package org.apache.tomcat.dbcp.dbcp2
Interface PoolableConnectionMXBean
-
- All Known Implementing Classes:
PoolableConnection
,PoolableManagedConnection
public interface PoolableConnectionMXBean
Defines the attributes and methods that will be exposed via JMX forPoolableConnection
instances.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearCachedState()
Clears the cached state.void
clearWarnings()
SeeConnection.clearWarnings()
.void
close()
Returns this instance to my containing pool.boolean
getAutoCommit()
SeeConnection.getAutoCommit()
.boolean
getCacheState()
Gets whether to cache properties.java.lang.String
getCatalog()
SeeConnection.getCatalog()
.int
getHoldability()
SeeConnection.getHoldability()
.java.lang.String
getSchema()
SeeConnection.getSchema()
.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.int
getTransactionIsolation()
SeeConnection.getTransactionIsolation()
.boolean
isClosed()
SeeConnection.isClosed()
.boolean
isReadOnly()
SeeConnection.isReadOnly()
.void
reallyClose()
Closes the underlyingConnection
.void
setAutoCommit(boolean autoCommit)
SeeConnection.setAutoCommit(boolean)
.void
setCacheState(boolean cacheState)
Sets whether to cache properties.void
setCatalog(java.lang.String catalog)
SeeConnection.setCatalog(String)
.void
setHoldability(int holdability)
SeeConnection.setHoldability(int)
.void
setReadOnly(boolean readOnly)
SeeConnection.setReadOnly(boolean)
.void
setSchema(java.lang.String schema)
SeeConnection.setSchema(String)
.void
setTransactionIsolation(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.SQLException
SeeConnection.clearWarnings()
.- Throws:
java.sql.SQLException
- SeeConnection.clearWarnings()
.
-
close
void close() throws java.sql.SQLException
Returns this instance to my containing pool.- Throws:
java.sql.SQLException
- Throw if this instance cannot be returned.
-
getAutoCommit
boolean getAutoCommit() throws java.sql.SQLException
SeeConnection.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.SQLException
SeeConnection.getCatalog()
.- Returns:
- See
Connection.getCatalog()
. - Throws:
java.sql.SQLException
- SeeConnection.getCatalog()
.
-
getHoldability
int getHoldability() throws java.sql.SQLException
SeeConnection.getHoldability()
.- Returns:
- See
Connection.getHoldability()
. - Throws:
java.sql.SQLException
- SeeConnection.getHoldability()
.
-
getSchema
java.lang.String getSchema() throws java.sql.SQLException
SeeConnection.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.SQLException
SeeConnection.getTransactionIsolation()
.- Returns:
- See
Connection.getTransactionIsolation()
. - Throws:
java.sql.SQLException
- SeeConnection.getTransactionIsolation()
.
-
isClosed
boolean isClosed() throws java.sql.SQLException
SeeConnection.isClosed()
.- Returns:
- See
Connection.isClosed()
. - Throws:
java.sql.SQLException
- SeeConnection.isClosed()
.
-
isReadOnly
boolean isReadOnly() throws java.sql.SQLException
SeeConnection.isReadOnly()
.- Returns:
- See
Connection.isReadOnly()
. - Throws:
java.sql.SQLException
- SeeConnection.isReadOnly()
.
-
reallyClose
void reallyClose() throws java.sql.SQLException
Closes the underlyingConnection
.- Throws:
java.sql.SQLException
- Thrown if the connection can be closed.
-
setAutoCommit
void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
SeeConnection.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.SQLException
SeeConnection.setCatalog(String)
.- Parameters:
catalog
- SeeConnection.setCatalog(String)
.- Throws:
java.sql.SQLException
- SeeConnection.setCatalog(String)
.
-
setHoldability
void setHoldability(int holdability) throws java.sql.SQLException
SeeConnection.setHoldability(int)
.- Parameters:
holdability
-Connection.setHoldability(int)
.- Throws:
java.sql.SQLException
- SeeConnection.setHoldability(int)
.
-
setReadOnly
void setReadOnly(boolean readOnly) throws java.sql.SQLException
SeeConnection.setReadOnly(boolean)
.- Parameters:
readOnly
- SeeConnection.setReadOnly(boolean)
.- Throws:
java.sql.SQLException
- SeeConnection.setReadOnly(boolean)
.
-
setSchema
void setSchema(java.lang.String schema) throws java.sql.SQLException
SeeConnection.setSchema(String)
.- Parameters:
schema
- SeeConnection.setSchema(String)
.- Throws:
java.sql.SQLException
- SeeConnection.setSchema(String)
.
-
setTransactionIsolation
void setTransactionIsolation(int level) throws java.sql.SQLException
SeeConnection.setTransactionIsolation(int)
.- Parameters:
level
- SeeConnection.setTransactionIsolation(int)
.- Throws:
java.sql.SQLException
- SeeConnection.setTransactionIsolation(int)
.
-
-