Top Description Methods
org.apache.derby.iapi.jdbc

public Interface BrokeredConnectionControl

Known Direct Implementers
org.apache.derby.impl.jdbc.EmbedPooledConnection
Imports
java.sql.SQLException, .Statement, .PreparedStatement, .CallableStatement

Provides control over a BrokeredConnection

Method Summary

Modifier and TypeMethod and Description
public void
checkAutoCommit(boolean
New auto commit setting
autoCommit
)

Allow control over setting auto commit mode.

public void
checkClose()

Check if the brokered connection can be closed.

public void
checkCommit()

Allow control over calling commit.

public int

Returns:

whether cursors can be held across commits
checkHoldCursors
(int
Current holdability
holdability
,
boolean
true to downgrade the holdability, false to throw an exception.
downgrade
)

Can cursors be held across commits.

public void
checkRollback()

Allow control over calling rollback.

public void
checkSavepoint()

Allow control over creating a Savepoint (JDBC 3.0)

public boolean

Returns:

true if getRealConnection().close() will be called
closingConnection
()

Close called on BrokeredConnection.

public EngineConnection

Returns:

the real JDBC connection
getRealConnection
()

Return the real JDBC connection for the brokered connection.

public boolean

Returns:

true if this is a global XA transaction
isInGlobalTransaction
()

Is this a global transaction

public boolean

Returns:

true if isolation level has been set by user
isIsolationLevelSetUsingSQLorJDBC
()

Returns true if isolation level has been set using JDBC/SQL.

public void
notifyException(SQLException
A sql exception
sqle
)

Notify the control class that a SQLException was thrown during a call on one of the brokered connection's methods.

public void
onStatementClose(PreparedStatement
PreparedStatement object on which the close event occurred
statement
)

Close called on the associated PreparedStatement object

public void
onStatementErrorOccurred(PreparedStatement
PreparedStatement object on which the error occured
statement
,
SQLException
The SQLExeption that caused the error
sqle
)

Error occurred on associated PreparedStatement object

public void
resetIsolationLevelFlag()

Reset the isolation level flag used to keep state in BrokeredConnection.

public Statement

Returns:

a wrapper statement
wrapStatement
(Statement
The original statement
realStatement
)

Optionally wrap a Statement with another Statement.

public PreparedStatement

Returns:

a wrapper statement
wrapStatement
(PreparedStatement
The original statement
realStatement
,
String
The sql to use
sql
,
Object
Key generation information
generateKeys
)

Optionally wrap a PreparedStatement with another PreparedStatement.

public CallableStatement

Returns:

a wrapper callable statement
wrapStatement
(CallableStatement
The original statement
realStatement
,
String
The sql text
sql
)

Optionally wrap a CallableStatement with an CallableStatement.

Method Detail

checkAutoCommitback to summary
public void checkAutoCommit(boolean autoCommit) throws SQLException

Allow control over setting auto commit mode.

Parameters
autoCommit:boolean

New auto commit setting

Exceptions
SQLException:
on error
checkCloseback to summary
public void checkClose() throws SQLException

Check if the brokered connection can be closed.

Exceptions
SQLException:
if it is not allowed to call close on the brokered connection
checkCommitback to summary
public void checkCommit() throws SQLException

Allow control over calling commit.

Exceptions
SQLException:
on error
checkHoldCursorsback to summary
public int checkHoldCursors(int holdability, boolean downgrade) throws SQLException

Can cursors be held across commits.

Parameters
holdability:int

Current holdability

downgrade:boolean

true to downgrade the holdability, false to throw an exception.

Returns:int

whether cursors can be held across commits

Exceptions
SQLException:
on error
checkRollbackback to summary
public void checkRollback() throws SQLException

Allow control over calling rollback.

Exceptions
SQLException:
on error
checkSavepointback to summary
public void checkSavepoint() throws SQLException

Allow control over creating a Savepoint (JDBC 3.0)

Exceptions
SQLException:
on error
closingConnectionback to summary
public boolean closingConnection() throws SQLException

Close called on BrokeredConnection. If this call returns true then getRealConnection().close() will be called.

Returns:boolean

true if getRealConnection().close() will be called

Exceptions
SQLException:
on error
getRealConnectionback to summary
public EngineConnection getRealConnection() throws SQLException

Return the real JDBC connection for the brokered connection.

Returns:EngineConnection

the real JDBC connection

Exceptions
SQLException:
on error
isInGlobalTransactionback to summary
public boolean isInGlobalTransaction()

Is this a global transaction

Returns:boolean

true if this is a global XA transaction

isIsolationLevelSetUsingSQLorJDBCback to summary
public boolean isIsolationLevelSetUsingSQLorJDBC() throws SQLException

Returns true if isolation level has been set using JDBC/SQL.

Returns:boolean

true if isolation level has been set by user

Exceptions
SQLException:
on error
notifyExceptionback to summary
public void notifyException(SQLException sqle)

Notify the control class that a SQLException was thrown during a call on one of the brokered connection's methods.

Parameters
sqle:SQLException

A sql exception

onStatementCloseback to summary
public void onStatementClose(PreparedStatement statement)

Close called on the associated PreparedStatement object

Parameters
statement:PreparedStatement

PreparedStatement object on which the close event occurred

onStatementErrorOccurredback to summary
public void onStatementErrorOccurred(PreparedStatement statement, SQLException sqle)

Error occurred on associated PreparedStatement object

Parameters
statement:PreparedStatement

PreparedStatement object on which the error occured

sqle:SQLException

The SQLExeption that caused the error

resetIsolationLevelFlagback to summary
public void resetIsolationLevelFlag() throws SQLException

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.

Exceptions
SQLException:
on error
wrapStatementback to summary
public Statement wrapStatement(Statement realStatement) throws SQLException

Optionally wrap a Statement with another Statement.

Parameters
realStatement:Statement

The original statement

Returns:Statement

a wrapper statement

Exceptions
SQLException:
on error
wrapStatementback to summary
public PreparedStatement wrapStatement(PreparedStatement realStatement, String sql, Object generateKeys) throws SQLException

Optionally wrap a PreparedStatement with another PreparedStatement.

Parameters
realStatement:PreparedStatement

The original statement

sql:String

The sql to use

generateKeys:Object

Key generation information

Returns:PreparedStatement

a wrapper statement

Exceptions
SQLException:
on error
wrapStatementback to summary
public CallableStatement wrapStatement(CallableStatement realStatement, String sql) throws SQLException

Optionally wrap a CallableStatement with an CallableStatement.

Parameters
realStatement:CallableStatement

The original statement

sql:String

The sql text

Returns:CallableStatement

a wrapper callable statement

Exceptions
SQLException:
on error