Package org.apache.derby.jdbc
Class XAStatementControl
java.lang.Object
org.apache.derby.jdbc.XAStatementControl
- All Implemented Interfaces:
BrokeredStatementControl
The Statement returned by an Connection returned by a XAConnection
needs to float across the underlying real connections. We do this by implementing
a wrapper statement.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BrokeredConnection
(package private) BrokeredStatement
private CallableStatement
private EmbedConnection
private PreparedStatement
private Statement
private final EmbedXAConnection
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
XAStatementControl
(EmbedXAConnection xaConnection) (package private)
XAStatementControl
(EmbedXAConnection xaConnection, CallableStatement realCallableStatement, String sql) (package private)
XAStatementControl
(EmbedXAConnection xaConnection, PreparedStatement realPreparedStatement, String sql, Object generatedKeys) (package private)
XAStatementControl
(EmbedXAConnection xaConnection, Statement realStatement) -
Method Summary
Modifier and TypeMethodDescriptionint
checkHoldCursors
(int holdability) Can cursors be held across commits.void
Close the realCallableStatement within this control.void
Close the realPreparedStatement within this control.void
Close the realStatement within this control.Return the real JDBC CallableStatement for the brokered statement when this is controlling a CallableStatement.Return the real JDBC PreparedStatement for the brokered statement when this is controlling a PreparedStatement.Return the real JDBC statement for the brokered statement when this is controlling a Statement.wrapResultSet
(Statement s, ResultSet rs) Don't need to wrap the ResultSet but do need to update its application Statement reference to be the one the application used to create the ResultSet.
-
Field Details
-
xaConnection
-
applicationConnection
-
applicationStatement
BrokeredStatement applicationStatement -
realConnection
-
realStatement
-
realPreparedStatement
-
realCallableStatement
-
-
Constructor Details
-
XAStatementControl
-
XAStatementControl
XAStatementControl(EmbedXAConnection xaConnection, Statement realStatement) throws SQLException - Throws:
SQLException
-
XAStatementControl
XAStatementControl(EmbedXAConnection xaConnection, PreparedStatement realPreparedStatement, String sql, Object generatedKeys) throws SQLException - Throws:
SQLException
-
XAStatementControl
XAStatementControl(EmbedXAConnection xaConnection, CallableStatement realCallableStatement, String sql) throws SQLException - Throws:
SQLException
-
-
Method Details
-
closeRealStatement
Close the realStatement within this control.- Specified by:
closeRealStatement
in interfaceBrokeredStatementControl
- Throws:
SQLException
-
closeRealCallableStatement
Close the realCallableStatement within this control.- Specified by:
closeRealCallableStatement
in interfaceBrokeredStatementControl
- Throws:
SQLException
-
closeRealPreparedStatement
Close the realPreparedStatement within this control.- Specified by:
closeRealPreparedStatement
in interfaceBrokeredStatementControl
- Throws:
SQLException
-
getRealStatement
Description copied from interface:BrokeredStatementControl
Return the real JDBC statement for the brokered statement when this is controlling a Statement.- Specified by:
getRealStatement
in interfaceBrokeredStatementControl
- Throws:
SQLException
-
getRealPreparedStatement
Description copied from interface:BrokeredStatementControl
Return the real JDBC PreparedStatement for the brokered statement when this is controlling a PreparedStatement.- Specified by:
getRealPreparedStatement
in interfaceBrokeredStatementControl
- Throws:
SQLException
-
getRealCallableStatement
Description copied from interface:BrokeredStatementControl
Return the real JDBC CallableStatement for the brokered statement when this is controlling a CallableStatement.- Specified by:
getRealCallableStatement
in interfaceBrokeredStatementControl
- Throws:
SQLException
-
wrapResultSet
Don't need to wrap the ResultSet but do need to update its application Statement reference to be the one the application used to create the ResultSet.- Specified by:
wrapResultSet
in interfaceBrokeredStatementControl
- Parameters:
s
- Statement that created the ResultSet.
-
checkHoldCursors
Can cursors be held across commits.- Specified by:
checkHoldCursors
in interfaceBrokeredStatementControl
- Throws:
SQLException
-