| java.lang.Object org.xorm.datastore.sql.PooledConnection
PooledConnection | class PooledConnection implements Connection(Code) | | A wrapper around a DB connection that provides the concept of being
logically closed, while keeping the db connection alive. This allows
the connection to be reused without having to re-establish a db connection.
author: Scott Bendar version: $Revision: 1.4 $ |
Method Summary | |
protected void | checkException(SQLException sqe) Called when an Exception is thrown by one of the wrapped JDBC Connection
methods. | public void | clearReceivedException() | public void | clearWarnings() | public void | close() Performs a logical close on the connection. | protected void | closeConnection() Closes the underlying db connection. | public void | commit() | public Statement | createStatement() | public Statement | createStatement(int resultSetType, int resultSetConcurrency) | public Statement | createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public boolean | getAutoCommit() | public String | getCatalog() | public int | getHoldability() | public long | getLastUsedTime() Return time in milliseconds when the connection was last used. | public DatabaseMetaData | getMetaData() | public int | getTransactionIsolation() | public Map | getTypeMap() | public SQLWarning | getWarnings() | public boolean | hasReceivedException() Returns true if any of the wrapped connections threw an exception
while the connection was in use. | public boolean | isClosed() Returns the state of this logical wrapper, not of the underlying
db connection. | protected boolean | isConnectionClosed() | 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 sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public PreparedStatement | prepareStatement(String sql) | public PreparedStatement | prepareStatement(String sql, int autoGeneratedKeys) | public PreparedStatement | prepareStatement(String sql, int[] columnIndexes) | public PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency) | public PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public PreparedStatement | prepareStatement(String sql, String[] columnNames) | public void | releaseSavepoint(Savepoint savepoint) | protected void | resetConnection() Try to reset a connection back to the state it was in when it was
first created so when its reused, the user doesn't get a connection
left in some funky state by the previous user. | public void | rollback() | public void | rollback(Savepoint savepoint) | public void | setAutoCommit(boolean autoCommit) | public void | setCatalog(String catalog) | protected void | setClosed(boolean c) Sets the closed state. | public void | setHoldability(int hold) | public void | setReadOnly(boolean ro) | public Savepoint | setSavepoint() | public Savepoint | setSavepoint(String name) | public void | setTransactionIsolation(int iso) | public void | setTypeMap(Map typeMap) |
autoCommit | protected boolean autoCommit(Code) | | the current state of commit mode
|
closed | protected boolean closed(Code) | | flag indicates if connection has been logically closed or not
|
defaultCatalog | protected String defaultCatalog(Code) | | default catalog
|
defaultIsolation | protected int defaultIsolation(Code) | | default transaction isolation level
|
defaultTypeMap | protected Map defaultTypeMap(Code) | | default type map
|
exceptionOccurred | protected boolean exceptionOccurred(Code) | | flag that indicates if we received an exception from any of our
wrapped connction methods. This will force a connection test
before giving the connection to anyone else.
|
lastUsed | protected long lastUsed(Code) | | The time the connection was last used
|
readOnly | protected boolean readOnly(Code) | | the current state of read only mode
|
PooledConnection | public PooledConnection(PooledDataSource dataSource, Connection newConn) throws SQLException(Code) | | Creates a new connection wrapper around the passed base connection.
The wrapper intercepts the close call and performs a logical close
and returns the connection to the owning pool.
The other calls are passed through to the real connection object.
Parameters: dataSource - the owning pooled data source Parameters: newConn - the actual db connection being wrapped |
checkException | protected void checkException(SQLException sqe) throws SQLException(Code) | | Called when an Exception is thrown by one of the wrapped JDBC Connection
methods. It logs that a connection was received which will force
the connection pool to recheck the connection before giving it to
someone else.
|
clearReceivedException | public void clearReceivedException()(Code) | | Clears the exception indicator
|
close | public void close() throws SQLException(Code) | | Performs a logical close on the connection. Any outstanding transaction
is rolled back and the connection properties are reset to their original
settings.
The connection is set to a closed state causing most methods to
throw an exception in case someone tries to use it after calling close.
Lastly, it tells its owner it is again available for use.
|
closeConnection | protected void closeConnection()(Code) | | Closes the underlying db connection. This is called by the owning
data source when it wants to get rid of the connection.
|
createStatement | public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code) | | |
getLastUsedTime | public long getLastUsedTime()(Code) | | Return time in milliseconds when the connection was last used.
|
hasReceivedException | public boolean hasReceivedException()(Code) | | Returns true if any of the wrapped connections threw an exception
while the connection was in use.
|
isClosed | public boolean isClosed()(Code) | | Returns the state of this logical wrapper, not of the underlying
db connection.
|
isConnectionClosed | protected boolean isConnectionClosed() throws SQLException(Code) | | Tests if the underlying connection is closed or not
|
resetConnection | protected void resetConnection() throws SQLException(Code) | | Try to reset a connection back to the state it was in when it was
first created so when its reused, the user doesn't get a connection
left in some funky state by the previous user.
|
setClosed | protected void setClosed(boolean c)(Code) | | Sets the closed state. This is called by the owning pool when
its ready to return the connection to a caller.
|
setTransactionIsolation | public void setTransactionIsolation(int iso) throws SQLException(Code) | | |
|
|