Package org.apache.derby.jdbc
Class XAStatementControl
- java.lang.Object
-
- org.apache.derby.jdbc.XAStatementControl
-
- All Implemented Interfaces:
BrokeredStatementControl
final class XAStatementControl extends java.lang.Object implements 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
Fields Modifier and Type Field Description private BrokeredConnectionapplicationConnection(package private) BrokeredStatementapplicationStatementprivate java.sql.CallableStatementrealCallableStatementprivate EmbedConnectionrealConnectionprivate java.sql.PreparedStatementrealPreparedStatementprivate java.sql.StatementrealStatementprivate EmbedXAConnectionxaConnection
-
Constructor Summary
Constructors Modifier Constructor Description privateXAStatementControl(EmbedXAConnection xaConnection)(package private)XAStatementControl(EmbedXAConnection xaConnection, java.sql.CallableStatement realCallableStatement, java.lang.String sql)(package private)XAStatementControl(EmbedXAConnection xaConnection, java.sql.PreparedStatement realPreparedStatement, java.lang.String sql, java.lang.Object generatedKeys)(package private)XAStatementControl(EmbedXAConnection xaConnection, java.sql.Statement realStatement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcheckHoldCursors(int holdability)Can cursors be held across commits.voidcloseRealCallableStatement()Close the realCallableStatement within this control.voidcloseRealPreparedStatement()Close the realPreparedStatement within this control.voidcloseRealStatement()Close the realStatement within this control.java.sql.CallableStatementgetRealCallableStatement()Return the real JDBC CallableStatement for the brokered statement when this is controlling a CallableStatement.java.sql.PreparedStatementgetRealPreparedStatement()Return the real JDBC PreparedStatement for the brokered statement when this is controlling a PreparedStatement.java.sql.StatementgetRealStatement()Return the real JDBC statement for the brokered statement when this is controlling a Statement.java.sql.ResultSetwrapResultSet(java.sql.Statement s, java.sql.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 Detail
-
xaConnection
private final EmbedXAConnection xaConnection
-
applicationConnection
private final BrokeredConnection applicationConnection
-
applicationStatement
BrokeredStatement applicationStatement
-
realConnection
private EmbedConnection realConnection
-
realStatement
private java.sql.Statement realStatement
-
realPreparedStatement
private java.sql.PreparedStatement realPreparedStatement
-
realCallableStatement
private java.sql.CallableStatement realCallableStatement
-
-
Constructor Detail
-
XAStatementControl
private XAStatementControl(EmbedXAConnection xaConnection)
-
XAStatementControl
XAStatementControl(EmbedXAConnection xaConnection, java.sql.Statement realStatement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
XAStatementControl
XAStatementControl(EmbedXAConnection xaConnection, java.sql.PreparedStatement realPreparedStatement, java.lang.String sql, java.lang.Object generatedKeys) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
XAStatementControl
XAStatementControl(EmbedXAConnection xaConnection, java.sql.CallableStatement realCallableStatement, java.lang.String sql) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-
Method Detail
-
closeRealStatement
public void closeRealStatement() throws java.sql.SQLExceptionClose the realStatement within this control.- Specified by:
closeRealStatementin interfaceBrokeredStatementControl- Throws:
java.sql.SQLException
-
closeRealCallableStatement
public void closeRealCallableStatement() throws java.sql.SQLExceptionClose the realCallableStatement within this control.- Specified by:
closeRealCallableStatementin interfaceBrokeredStatementControl- Throws:
java.sql.SQLException
-
closeRealPreparedStatement
public void closeRealPreparedStatement() throws java.sql.SQLExceptionClose the realPreparedStatement within this control.- Specified by:
closeRealPreparedStatementin interfaceBrokeredStatementControl- Throws:
java.sql.SQLException
-
getRealStatement
public java.sql.Statement getRealStatement() throws java.sql.SQLExceptionDescription copied from interface:BrokeredStatementControlReturn the real JDBC statement for the brokered statement when this is controlling a Statement.- Specified by:
getRealStatementin interfaceBrokeredStatementControl- Throws:
java.sql.SQLException
-
getRealPreparedStatement
public java.sql.PreparedStatement getRealPreparedStatement() throws java.sql.SQLExceptionDescription copied from interface:BrokeredStatementControlReturn the real JDBC PreparedStatement for the brokered statement when this is controlling a PreparedStatement.- Specified by:
getRealPreparedStatementin interfaceBrokeredStatementControl- Throws:
java.sql.SQLException
-
getRealCallableStatement
public java.sql.CallableStatement getRealCallableStatement() throws java.sql.SQLExceptionDescription copied from interface:BrokeredStatementControlReturn the real JDBC CallableStatement for the brokered statement when this is controlling a CallableStatement.- Specified by:
getRealCallableStatementin interfaceBrokeredStatementControl- Throws:
java.sql.SQLException
-
wrapResultSet
public java.sql.ResultSet wrapResultSet(java.sql.Statement s, java.sql.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.- Specified by:
wrapResultSetin interfaceBrokeredStatementControl- Parameters:
s- Statement that created the ResultSet.
-
checkHoldCursors
public int checkHoldCursors(int holdability) throws java.sql.SQLExceptionCan cursors be held across commits.- Specified by:
checkHoldCursorsin interfaceBrokeredStatementControl- Throws:
java.sql.SQLException
-
-