|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.client.am.StatementCacheInteractor
public final class StatementCacheInteractor
Utility class encapsulating the logic for interacting with the JDBC statement cache when creating new logical statements.
This class was introduced to share code between the pre-JDBC 4 and the JDBC 4+ versions of the JDBC classes.
The pattern for the prepareX
methods is:
Field Summary | |
---|---|
private JDBCStatementCache |
cache
Statement cache for the associated physical connection. |
private boolean |
connCloseInProgress
Tells if this interactor is in the process of shutting down. |
private java.util.ArrayList |
openLogicalStatements
List of open logical statements created by this cache interactor. |
private Connection |
physicalConnection
The underlying physical connection. |
Constructor Summary | |
---|---|
StatementCacheInteractor(JDBCStatementCache cache,
Connection physicalConnection)
Creates a new JDBC statement cache interactor. |
Method Summary | |
---|---|
void |
closeOpenLogicalStatements()
Closes all open logical statements created by this cache interactor. |
private java.sql.CallableStatement |
createLogicalCallableStatement(java.sql.CallableStatement cs,
StatementKey stmtKey)
Creates a logical callable statement. |
private java.sql.PreparedStatement |
createLogicalPreparedStatement(java.sql.PreparedStatement ps,
StatementKey stmtKey)
Creates a logical prepared statement. |
(package private) JDBCStatementCache |
getCache()
Returns the associated statement cache. |
void |
markClosed(LogicalStatementEntity logicalStmt)
Designates the specified logical statement as closed. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final JDBCStatementCache cache
private final Connection physicalConnection
Note that it is the responsibility of the logical statement assoiciated with this cache interactor to ensure the interactor methods are not invoked if the logical statement has been closed.
private final java.util.ArrayList openLogicalStatements
private boolean connCloseInProgress
If this is true, it means that the logical connection is being closed.
Constructor Detail |
---|
StatementCacheInteractor(JDBCStatementCache cache, Connection physicalConnection)
cache
- statement cachephysicalConnection
- associated physical connectionMethod Detail |
---|
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
Connection.prepareStatement(String)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
java.sql.SQLException
Connection.prepareStatement(String,int,int)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
java.sql.SQLException
Connection.prepareStatement(String,int,int,int)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
java.sql.SQLException
Connection.prepareStatement(String,int)
public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
Connection.prepareCall(String)
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
java.sql.SQLException
Connection.prepareCall(String,int,int)
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
java.sql.SQLException
Connection.prepareCall(String,int,int,int)
public void closeOpenLogicalStatements() throws java.sql.SQLException
A cache interactor is bound to a single (caching) logical connection.
java.sql.SQLException
- if closing an open logical connection failspublic void markClosed(LogicalStatementEntity logicalStmt)
logicalStmt
- the logical statement being closedprivate java.sql.PreparedStatement createLogicalPreparedStatement(java.sql.PreparedStatement ps, StatementKey stmtKey) throws java.sql.SQLException
ps
- the underlying physical prepared statementstmtKey
- the statement key for the physical statement
java.sql.SQLException
- if creating a logical prepared statement failsprivate java.sql.CallableStatement createLogicalCallableStatement(java.sql.CallableStatement cs, StatementKey stmtKey) throws java.sql.SQLException
cs
- the underlying physical callable statementstmtKey
- the statement key for the physical statement
java.sql.SQLException
- if creating a logical callable statement failsJDBCStatementCache getCache()
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |