|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.enhydra.jdbc.core.CoreConnection
|
+--org.enhydra.jdbc.standard.StandardConnectionHandle
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.
| Field Summary | |
java.util.Hashtable |
inUse
|
protected java.util.Hashtable |
masterPrepStmtCache
|
protected LRUCache |
preparedStatementCache
|
| Fields inherited from class org.enhydra.jdbc.core.CoreConnection |
con |
| Fields inherited from interface java.sql.Connection |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
StandardConnectionHandle(StandardPooledConnection pooledCon,
java.util.Hashtable preparedStatementCache,
int preparedStmtCacheSize)
Constructor. |
|
| Method Summary | |
void |
catchInvoke(java.sql.SQLException e)
Exception management : catch or throw the exception |
void |
close()
Closes this StandardConnectionHandle and prevents it from being reused. |
protected java.sql.PreparedStatement |
createPreparedStatement(java.lang.String sql,
int type,
int concurrency)
|
boolean |
isClosed()
|
void |
preInvoke()
Pre-invokation of the delegation, in case of connection is closed, we throw an exception |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Creates a PreparedStatement for the given SQL. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Creates a PreparedStatement for the given SQL, type and concurrency. |
protected void |
setupPreparedStatementCache()
|
| Methods inherited from class org.enhydra.jdbc.core.CoreConnection |
clearWarnings, commit, createStatement, createStatement, createStatement, getAutoCommit, getCatalog, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Hashtable masterPrepStmtCache
protected LRUCache preparedStatementCache
public java.util.Hashtable inUse
| Constructor Detail |
public StandardConnectionHandle(StandardPooledConnection pooledCon,
java.util.Hashtable preparedStatementCache,
int preparedStmtCacheSize)
| Method Detail |
protected void setupPreparedStatementCache()
public void preInvoke()
throws java.sql.SQLException
preInvoke in class CoreConnectionjava.sql.SQLException
public void catchInvoke(java.sql.SQLException e)
throws java.sql.SQLException
catchInvoke in class CoreConnectionjava.sql.SQLException
public void close()
throws java.sql.SQLException
close in interface java.sql.Connectionclose in class CoreConnectionjava.sql.SQLException
protected java.sql.PreparedStatement createPreparedStatement(java.lang.String sql,
int type,
int concurrency)
throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
prepareStatement in interface java.sql.ConnectionprepareStatement in class CoreConnectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareStatement in interface java.sql.ConnectionprepareStatement in class CoreConnectionjava.sql.SQLException
public boolean isClosed()
throws java.sql.SQLException
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
java.sql.SQLException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||