| java.lang.Object org.ofbiz.minerva.pool.jdbc.ConnectionInPool
ConnectionInPool | public class ConnectionInPool implements PooledObject,ConnectionWrapper(Code) | | Wrapper for database connections in a pool. Handles closing appropriately.
The connection is returned to the pool rather than truly closing, any
outstanding statements are closed, and the connection is rolled back. This
class is also used by statements, etc. to update the last used time for the
connection.
author: Aaron Mulder (ammulder@alumni.princeton.edu) |
Method Summary | |
public void | addPoolEventListener(PoolEventListener listener) Adds a listener for pool events. | public void | clearWarnings() | public void | close() | public void | commit() | public Statement | createStatement() | public Statement | createStatement(int resultSetType, int resultSetConcurrency) | public Statement | createStatement(int arg0, int arg1, int arg2) | protected void | firePoolEvent(PoolEvent evt) Dispatches an event to the listeners. | public boolean | getAutoCommit() | public String | getCatalog() | public int | getHoldability() | public DatabaseMetaData | getMetaData() | public int | getPSCacheSize() Gets the number of PreparedStatements to be cached for each
Connection. | public int | getTransactionIsolation() | public Map | getTypeMap() | public Connection | getUnderlyingConnection() Gets a reference to the "real" connection. | public SQLWarning | getWarnings() | public boolean | isClosed() | public boolean | isReadOnly() | public String | nativeSQL(String sql) | public CallableStatement | prepareCall(String sql) | public CallableStatement | prepareCall(String sql, int resultSetType, int resultSetConcurrency) | public CallableStatement | prepareCall(String arg0, int arg1, int arg2, int arg3) | public PreparedStatement | prepareStatement(String sql) | public PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency) | public PreparedStatement | prepareStatement(String arg0, int arg1, int arg2, int arg3) | public PreparedStatement | prepareStatement(String arg0, int arg1) | public PreparedStatement | prepareStatement(String arg0, int[] arg1) | public PreparedStatement | prepareStatement(String arg0, String[] arg1) | public void | releaseSavepoint(Savepoint arg0) | public void | removePoolEventListener(PoolEventListener listener) Removes a listener for pool events. | public void | reset() Prepares a connection to be returned to the pool. | public void | rollback() | public void | rollback(Savepoint arg0) | public void | setAutoCommit(boolean autoCommit) | public void | setCatalog(String catalog) | public void | setCatastrophicError(SQLException e) Indicates that an error occured on this connection. | public void | setError(SQLException e) Indicates that an error occured on this connection. | public void | setHoldability(int arg0) | public void | setLastUsed() Updates the last used time for this connection to the current time. | public void | setPSCacheSize(int maxSize) Sets the number of PreparedStatements to be cached for each
Connection. | public void | setReadOnly(boolean readOnly) | public Savepoint | setSavepoint() | public Savepoint | setSavepoint(String arg0) | public void | setTransactionIsolation(int level) | public void | setTypeMap(Map map) | public void | shutdown() Closes this connection wrapper permanently. | public void | statementClosed(Statement st) Indicates that a statement has been closed and no longer needs to be
tracked. |
PS_CACHE_DISABLED | final public static int PS_CACHE_DISABLED(Code) | | |
PS_CACHE_UNLIMITED | final public static int PS_CACHE_UNLIMITED(Code) | | |
ConnectionInPool | public ConnectionInPool(Connection con)(Code) | | Creates a new connection wrapper.
Parameters: con - The "real" database connection to wrap. |
addPoolEventListener | public void addPoolEventListener(PoolEventListener listener)(Code) | | Adds a listener for pool events.
|
firePoolEvent | protected void firePoolEvent(PoolEvent evt)(Code) | | Dispatches an event to the listeners.
|
getPSCacheSize | public int getPSCacheSize()(Code) | | Gets the number of PreparedStatements to be cached for each
Connection.
|
getUnderlyingConnection | public Connection getUnderlyingConnection()(Code) | | Gets a reference to the "real" connection. This should only be used if
you need to cast that to a specific type to call a proprietary method -
you will defeat all the pooling if you use the underlying connection
directly.
|
removePoolEventListener | public void removePoolEventListener(PoolEventListener listener)(Code) | | Removes a listener for pool events.
|
reset | public void reset() throws SQLException(Code) | | Prepares a connection to be returned to the pool. All outstanding
statements are closed, and if AutoCommit is off, the connection is
rolled back. No further SQL calls are possible once this is called.
|
setCatastrophicError | public void setCatastrophicError(SQLException e)(Code) | | Indicates that an error occured on this connection.
|
setError | public void setError(SQLException e)(Code) | | Indicates that an error occured on this connection.
|
setLastUsed | public void setLastUsed()(Code) | | Updates the last used time for this connection to the current time.
|
setTransactionIsolation | public void setTransactionIsolation(int level) throws SQLException(Code) | | |
shutdown | public void shutdown()(Code) | | Closes this connection wrapper permanently. All further calls with throw
a SQLException.
|
statementClosed | public void statementClosed(Statement st)(Code) | | Indicates that a statement has been closed and no longer needs to be
tracked. Outstanding statements are closed when the connection is
returned to the pool.
|
|
|