Package org.apache.derby.iapi.jdbc
Interface BrokeredConnectionControl
-
- All Known Implementing Classes:
EmbedPooledConnection,EmbedXAConnection
public interface BrokeredConnectionControlProvides control over a BrokeredConnection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckAutoCommit(boolean autoCommit)Allow control over setting auto commit mode.voidcheckClose()Check if the brokered connection can be closed.voidcheckCommit()Allow control over calling commit.intcheckHoldCursors(int holdability, boolean downgrade)Can cursors be held across commits.voidcheckRollback()Allow control over calling rollback.voidcheckSavepoint()Allow control over creating a Savepoint (JDBC 3.0)booleanclosingConnection()Close called on BrokeredConnection.EngineConnectiongetRealConnection()Return the real JDBC connection for the brokered connection.booleanisInGlobalTransaction()Is this a global transactionbooleanisIsolationLevelSetUsingSQLorJDBC()Returns true if isolation level has been set using JDBC/SQL.voidnotifyException(java.sql.SQLException sqle)Notify the control class that a SQLException was thrown during a call on one of the brokered connection's methods.voidonStatementClose(java.sql.PreparedStatement statement)Close called on the associated PreparedStatement objectvoidonStatementErrorOccurred(java.sql.PreparedStatement statement, java.sql.SQLException sqle)Error occurred on associated PreparedStatement objectvoidresetIsolationLevelFlag()Reset the isolation level flag used to keep state in BrokeredConnection.java.sql.CallableStatementwrapStatement(java.sql.CallableStatement realStatement, java.lang.String sql)Optionally wrap a CallableStatement with an CallableStatement.java.sql.PreparedStatementwrapStatement(java.sql.PreparedStatement realStatement, java.lang.String sql, java.lang.Object generateKeys)Optionally wrap a PreparedStatement with another PreparedStatement.java.sql.StatementwrapStatement(java.sql.Statement realStatement)Optionally wrap a Statement with another Statement.
-
-
-
Method Detail
-
getRealConnection
EngineConnection getRealConnection() throws java.sql.SQLException
Return the real JDBC connection for the brokered connection.- Throws:
java.sql.SQLException
-
notifyException
void notifyException(java.sql.SQLException sqle)
Notify the control class that a SQLException was thrown during a call on one of the brokered connection's methods.
-
checkAutoCommit
void checkAutoCommit(boolean autoCommit) throws java.sql.SQLExceptionAllow control over setting auto commit mode.- Throws:
java.sql.SQLException
-
checkSavepoint
void checkSavepoint() throws java.sql.SQLExceptionAllow control over creating a Savepoint (JDBC 3.0)- Throws:
java.sql.SQLException
-
checkRollback
void checkRollback() throws java.sql.SQLExceptionAllow control over calling rollback.- Throws:
java.sql.SQLException
-
checkCommit
void checkCommit() throws java.sql.SQLExceptionAllow control over calling commit.- Throws:
java.sql.SQLException
-
checkClose
void checkClose() throws java.sql.SQLExceptionCheck if the brokered connection can be closed.- Throws:
java.sql.SQLException- if it is not allowed to call close on the brokered connection
-
checkHoldCursors
int checkHoldCursors(int holdability, boolean downgrade) throws java.sql.SQLExceptionCan cursors be held across commits.- Parameters:
downgrade- true to downgrade the holdability, false to throw an exception.- Throws:
java.sql.SQLException
-
isIsolationLevelSetUsingSQLorJDBC
boolean isIsolationLevelSetUsingSQLorJDBC() throws java.sql.SQLExceptionReturns true if isolation level has been set using JDBC/SQL.- Throws:
java.sql.SQLException
-
resetIsolationLevelFlag
void resetIsolationLevelFlag() throws java.sql.SQLExceptionReset the isolation level flag used to keep state in BrokeredConnection. It will get set to true when isolation level is set using JDBC/SQL. It will get reset to false at the start and the end of a global transaction.- Throws:
java.sql.SQLException
-
isInGlobalTransaction
boolean isInGlobalTransaction()
Is this a global transaction- Returns:
- true if this is a global XA transaction
-
closingConnection
boolean closingConnection() throws java.sql.SQLExceptionClose called on BrokeredConnection. If this call returns true then getRealConnection().close() will be called.- Throws:
java.sql.SQLException
-
wrapStatement
java.sql.Statement wrapStatement(java.sql.Statement realStatement) throws java.sql.SQLExceptionOptionally wrap a Statement with another Statement.- Throws:
java.sql.SQLException
-
wrapStatement
java.sql.PreparedStatement wrapStatement(java.sql.PreparedStatement realStatement, java.lang.String sql, java.lang.Object generateKeys) throws java.sql.SQLExceptionOptionally wrap a PreparedStatement with another PreparedStatement.- Throws:
java.sql.SQLException
-
wrapStatement
java.sql.CallableStatement wrapStatement(java.sql.CallableStatement realStatement, java.lang.String sql) throws java.sql.SQLExceptionOptionally wrap a CallableStatement with an CallableStatement.- Throws:
java.sql.SQLException
-
onStatementClose
void onStatementClose(java.sql.PreparedStatement statement)
Close called on the associated PreparedStatement object- Parameters:
statement- PreparedStatement object on which the close event occurred
-
onStatementErrorOccurred
void onStatementErrorOccurred(java.sql.PreparedStatement statement, java.sql.SQLException sqle)Error occurred on associated PreparedStatement object- Parameters:
statement- PreparedStatement object on which the error occuredsqle- The SQLExeption that caused the error
-
-