| org.enhydra.jdbc.core.CoreConnection org.enhydra.jdbc.standard.StandardConnectionHandle
All known Subclasses: org.enhydra.jdbc.sybase.SybaseConnectionHandle, org.enhydra.jdbc.standard.StandardXAConnectionHandle, org.enhydra.jdbc.informix.InformixConnectionHandle,
StandardConnectionHandle | public class StandardConnectionHandle extends CoreConnection (Code) | | This is an implementation of java.sql.Connection which simply
delegates almost everything to an underlying physical implemention
of the same interface.
It relies on a StandardPooledConnection to create it and to supply the
physical connection and a cache of PreparedStatements. This class will
try to re-use PreparedStatements wherever possible and will add to the
cache when totally new PreparedStatements get created.
|
Method Summary | |
public void | catchInvoke(SQLException e) | synchronized PreparedStatement | checkPreparedCache(String sql, int type, int concurrency, int holdability) Checks to see if a prepared statement with the same concurrency
has already been created. | synchronized PreparedStatement | checkPreparedCache(String sql, int autogeneratedkeys) | public synchronized void | close() Closes this StandardConnectionHandle and prevents it
from being reused. | protected PreparedStatement | createPreparedStatement(String sql, int type, int concurrency, int holdability) | protected PreparedStatement | createPreparedStatement(String sql, int autogeneratedkeys) | public Statement | createStatement() | public Statement | createStatementWrapper() | public boolean | isClosed() | public void | preInvoke() | public CallableStatement | prepareCall(String sql, int resultSetType, int resultSetConcurrency) | public PreparedStatement | prepareStatement(String sql) Creates a PreparedStatement for the given SQL. | public PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency) Creates a PreparedStatement for the given SQL, type and concurrency. | public PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | void | returnToCache(Object key, Connection theCon) Removes a prepared statement from the inUse list
and returns it to the cache. | void | returnToCache(Object key) | protected void | setupPreparedStatementCache() |
isReallyUsed | public boolean isReallyUsed(Code) | | |
preparedStmtCacheSize | int preparedStmtCacheSize(Code) | | |
checkPreparedCache | synchronized PreparedStatement checkPreparedCache(String sql, int type, int concurrency, int holdability) throws SQLException(Code) | | Checks to see if a prepared statement with the same concurrency
has already been created. If not, then a new prepared statement
is created and added to the cache.
If a prepared statement is found in the cache then it is removed
from the cache and placed on the "inUse" list. This ensures that
if multiple threads use the same StandardConnectionHandle, or a single
thread does multiple prepares using the same SQL, then DIFFERENT
prepared statements will be returned.
|
close | public synchronized void close() throws SQLException(Code) | | Closes this StandardConnectionHandle and prevents it
from being reused. It also returns used PreparedStatements
to the PreparedStatement cache and notifies all listeners.
|
preInvoke | public void preInvoke() throws SQLException(Code) | | Pre-invokation of the delegation, in case of connection is
closed, we throw an exception
|
prepareStatement | public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | Creates a PreparedStatement for the given SQL, type and concurrency.
If possible, the statement is fetched from the cache.
|
returnToCache | void returnToCache(Object key, Connection theCon)(Code) | | Removes a prepared statement from the inUse list
and returns it to the cache.
|
setupPreparedStatementCache | protected void setupPreparedStatementCache()(Code) | | |
Methods inherited from org.enhydra.jdbc.core.CoreConnection | abstract public void catchInvoke(SQLException e) throws SQLException(Code)(Java Doc) public void clearWarnings() throws SQLException(Code)(Java Doc) public void close() throws SQLException(Code)(Java Doc) public void commit() throws SQLException(Code)(Java Doc) public Statement createStatement() throws SQLException(Code)(Java Doc) public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException(Code)(Java Doc) public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code)(Java Doc) public boolean getAutoCommit() throws SQLException(Code)(Java Doc) public String getCatalog() throws SQLException(Code)(Java Doc) public int getHoldability() throws SQLException(Code)(Java Doc) public DatabaseMetaData getMetaData() throws SQLException(Code)(Java Doc) public int getTransactionIsolation() throws SQLException(Code)(Java Doc) public Map getTypeMap() throws SQLException(Code)(Java Doc) public SQLWarning getWarnings() throws SQLException(Code)(Java Doc) public boolean isClosed() throws SQLException(Code)(Java Doc) public boolean isReadOnly() throws SQLException(Code)(Java Doc) public String nativeSQL(String sql) throws SQLException(Code)(Java Doc) abstract public void preInvoke() throws SQLException(Code)(Java Doc) public CallableStatement prepareCall(String sql) throws SQLException(Code)(Java Doc) public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code)(Java Doc) public PreparedStatement prepareStatement(String sql) throws SQLException(Code)(Java Doc) public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code)(Java Doc) public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException(Code)(Java Doc) public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code)(Java Doc) public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException(Code)(Java Doc) public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException(Code)(Java Doc) public void releaseSavepoint(java.sql.Savepoint savepoint) throws SQLException(Code)(Java Doc) public void rollback() throws SQLException(Code)(Java Doc) public void rollback(java.sql.Savepoint savepoint) throws SQLException(Code)(Java Doc) public void setAutoCommit(boolean autoCommit) throws SQLException(Code)(Java Doc) public void setCatalog(String catalog) throws SQLException(Code)(Java Doc) public void setHoldability(int holdability) throws SQLException(Code)(Java Doc) public void setReadOnly(boolean readOnly) throws SQLException(Code)(Java Doc) public java.sql.Savepoint setSavepoint() throws SQLException(Code)(Java Doc) public java.sql.Savepoint setSavepoint(String name) throws SQLException(Code)(Java Doc) public void setTransactionIsolation(int level) throws SQLException(Code)(Java Doc) public void setTypeMap(Map map) throws SQLException(Code)(Java Doc)
|
|
|