Package org.apache.derby.iapi.jdbc
Interface BrokeredConnectionControl
- All Known Implementing Classes:
EmbedPooledConnection
,EmbedXAConnection
public interface BrokeredConnectionControl
Provides control over a BrokeredConnection
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkAutoCommit
(boolean autoCommit) Allow control over setting auto commit mode.void
Check if the brokered connection can be closed.void
Allow control over calling commit.int
checkHoldCursors
(int holdability, boolean downgrade) Can cursors be held across commits.void
Allow control over calling rollback.void
Allow control over creating a Savepoint (JDBC 3.0)boolean
Close called on BrokeredConnection.Return the real JDBC connection for the brokered connection.boolean
Is this a global transactionboolean
Returns true if isolation level has been set using JDBC/SQL.void
notifyException
(SQLException sqle) Notify the control class that a SQLException was thrown during a call on one of the brokered connection's methods.void
onStatementClose
(PreparedStatement statement) Close called on the associated PreparedStatement objectvoid
onStatementErrorOccurred
(PreparedStatement statement, SQLException sqle) Error occurred on associated PreparedStatement objectvoid
Reset the isolation level flag used to keep state in BrokeredConnection.wrapStatement
(CallableStatement realStatement, String sql) Optionally wrap a CallableStatement with an CallableStatement.wrapStatement
(PreparedStatement realStatement, String sql, Object generateKeys) Optionally wrap a PreparedStatement with another PreparedStatement.wrapStatement
(Statement realStatement) Optionally wrap a Statement with another Statement.
-
Method Details
-
getRealConnection
Return the real JDBC connection for the brokered connection.- Throws:
SQLException
-
notifyException
Notify the control class that a SQLException was thrown during a call on one of the brokered connection's methods. -
checkAutoCommit
Allow control over setting auto commit mode.- Throws:
SQLException
-
checkSavepoint
Allow control over creating a Savepoint (JDBC 3.0)- Throws:
SQLException
-
checkRollback
Allow control over calling rollback.- Throws:
SQLException
-
checkCommit
Allow control over calling commit.- Throws:
SQLException
-
checkClose
Check if the brokered connection can be closed.- Throws:
SQLException
- if it is not allowed to call close on the brokered connection
-
checkHoldCursors
Can cursors be held across commits.- Parameters:
downgrade
- true to downgrade the holdability, false to throw an exception.- Throws:
SQLException
-
isIsolationLevelSetUsingSQLorJDBC
Returns true if isolation level has been set using JDBC/SQL.- Throws:
SQLException
-
resetIsolationLevelFlag
Reset 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:
SQLException
-
isInGlobalTransaction
boolean isInGlobalTransaction()Is this a global transaction- Returns:
- true if this is a global XA transaction
-
closingConnection
Close called on BrokeredConnection. If this call returns true then getRealConnection().close() will be called.- Throws:
SQLException
-
wrapStatement
Optionally wrap a Statement with another Statement.- Throws:
SQLException
-
wrapStatement
PreparedStatement wrapStatement(PreparedStatement realStatement, String sql, Object generateKeys) throws SQLException Optionally wrap a PreparedStatement with another PreparedStatement.- Throws:
SQLException
-
wrapStatement
Optionally wrap a CallableStatement with an CallableStatement.- Throws:
SQLException
-
onStatementClose
Close called on the associated PreparedStatement object- Parameters:
statement
- PreparedStatement object on which the close event occurred
-
onStatementErrorOccurred
Error occurred on associated PreparedStatement object- Parameters:
statement
- PreparedStatement object on which the error occuredsqle
- The SQLExeption that caused the error
-