Top Description Fields Constructors Methods
org.apache.derby.impl.jdbc

pack-priv final Class XAStatementControl

extends Object
implements BrokeredStatementControl
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.jdbc.BrokeredStatementControl
Imports
org.apache.derby.iapi.jdbc.BrokeredConnection, .BrokeredStatementControl, .BrokeredStatement, .BrokeredPreparedStatement, .BrokeredCallableStatement, org.apache.derby.impl.jdbc.EmbedConnection, .EmbedResultSet, .EmbedStatement, .EmbedPreparedStatement, java.sql.*

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

Modifier and TypeField and Description
private final BrokeredConnection
pack-priv BrokeredStatement
private CallableStatement
private EmbedConnection
private PreparedStatement
private Statement
private final EmbedXAConnection

Constructor Summary

AccessConstructor and Description
private
pack-priv
XAStatementControl(EmbedXAConnection xaConnection, Statement realStatement)

pack-priv
XAStatementControl(EmbedXAConnection xaConnection, PreparedStatement realPreparedStatement, String sql, Object generatedKeys)

pack-priv
XAStatementControl(EmbedXAConnection xaConnection, CallableStatement realCallableStatement, String sql)

Method Summary

Modifier and TypeMethod and Description
public int
checkHoldCursors(int
The desired holdability
holdability
)

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.checkHoldCursors.

Can cursors be held across commits.

public void
public void
public void
closeRealStatement()

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.closeRealStatement.

Close the realStatement within this control.

public CallableStatement
getRealCallableStatement()

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.getRealCallableStatement.

Return the real JDBC CallableStatement for the brokered statement when this is controlling a CallableStatement.

public PreparedStatement
getRealPreparedStatement()

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.getRealPreparedStatement.

Return the real JDBC PreparedStatement for the brokered statement when this is controlling a PreparedStatement.

public Statement
getRealStatement()

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.getRealStatement.

Return the real JDBC statement for the brokered statement when this is controlling a Statement.

public ResultSet
wrapResultSet(Statement
Statement that created the ResultSet.
s
,
ResultSet
The ResultSet to wrap
rs
)

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

applicationConnectionback to summary
private final BrokeredConnection applicationConnection
applicationStatementback to summary
pack-priv BrokeredStatement applicationStatement
realCallableStatementback to summary
private CallableStatement realCallableStatement
realConnectionback to summary
private EmbedConnection realConnection
realPreparedStatementback to summary
private PreparedStatement realPreparedStatement
realStatementback to summary
private Statement realStatement
xaConnectionback to summary
private final EmbedXAConnection xaConnection

Constructor Detail

XAStatementControlback to summary
private XAStatementControl(EmbedXAConnection xaConnection)
XAStatementControlback to summary
pack-priv XAStatementControl(EmbedXAConnection xaConnection, Statement realStatement) throws SQLException
XAStatementControlback to summary
pack-priv XAStatementControl(EmbedXAConnection xaConnection, PreparedStatement realPreparedStatement, String sql, Object generatedKeys) throws SQLException
XAStatementControlback to summary
pack-priv XAStatementControl(EmbedXAConnection xaConnection, CallableStatement realCallableStatement, String sql) throws SQLException

Method Detail

checkHoldCursorsback to summary
public int checkHoldCursors(int holdability) throws SQLException

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.checkHoldCursors.

Can cursors be held across commits.

Parameters
holdability:int

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.checkHoldCursors.

The desired holdability

Returns:int

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.checkHoldCursors.

the actual holdability

Exceptions
SQLException:

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.checkHoldCursors.

on error

closeRealCallableStatementback to summary
public void closeRealCallableStatement() throws SQLException

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.closeRealCallableStatement.

Close the realCallableStatement within this control.

Exceptions
SQLException:

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.closeRealCallableStatement.

on error

closeRealPreparedStatementback to summary
public void closeRealPreparedStatement() throws SQLException

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.closeRealPreparedStatement.

Close the realPreparedStatement within this control.

Exceptions
SQLException:

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.closeRealPreparedStatement.

on error

closeRealStatementback to summary
public void closeRealStatement() throws SQLException

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.closeRealStatement.

Close the realStatement within this control.

Exceptions
SQLException:

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.closeRealStatement.

on error

getRealCallableStatementback to summary
public CallableStatement getRealCallableStatement() throws SQLException

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.getRealCallableStatement.

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.getRealCallableStatement.

Return the real JDBC CallableStatement for the brokered statement when this is controlling a CallableStatement.

Returns:CallableStatement

the real callable statement

Exceptions
SQLException:
on error
getRealPreparedStatementback to summary
public PreparedStatement getRealPreparedStatement() throws SQLException

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.getRealPreparedStatement.

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.getRealPreparedStatement.

Return the real JDBC PreparedStatement for the brokered statement when this is controlling a PreparedStatement.

Returns:PreparedStatement

the real prepared statement

Exceptions
SQLException:
on error
getRealStatementback to summary
public Statement getRealStatement() throws SQLException

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.getRealStatement.

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.getRealStatement.

Return the real JDBC statement for the brokered statement when this is controlling a Statement.

Returns:Statement

the real statement

Exceptions
SQLException:
on error
wrapResultSetback to summary
public ResultSet wrapResultSet(Statement s, ResultSet rs)

Implements org.apache.derby.iapi.jdbc.BrokeredStatementControl.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.

Parameters
s:Statement

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.wrapResultSet.

Statement that created the ResultSet.

rs:ResultSet

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.wrapResultSet.

The ResultSet to wrap

Returns:ResultSet

Doc from org.apache.derby.iapi.jdbc.BrokeredStatementControl.wrapResultSet.

the wrapper ResultSet