class EmbedXAConnection extends EmbedPooledConnection implements javax.sql.XAConnection
Modifier and Type | Field and Description |
---|---|
private EmbedXAResource |
xaRes |
currentConnectionHandle, dataSource, defaultIsolationLevel, isActive, realConnection
Constructor and Description |
---|
EmbedXAConnection(BasicEmbeddedDataSource40 ds,
ResourceAdapter ra,
java.lang.String u,
java.lang.String p,
boolean requestPassword) |
Modifier and Type | Method and Description |
---|---|
void |
checkAutoCommit(boolean autoCommit)
Allow control over setting auto commit mode.
|
void |
checkClose()
Check if the brokered connection can be closed.
|
void |
checkCommit()
Allow control over calling commit.
|
int |
checkHoldCursors(int holdability,
boolean downgrade)
Are held cursors allowed.
|
void |
checkRollback()
Allow control over calling rollback.
|
void |
checkSavepoint()
Allow control over creating a Savepoint (JDBC 3.0)
|
java.sql.Connection |
getConnection()
Create an object handle for a database connection.
|
EngineConnection |
getRealConnection()
Override getRealConnection to create a a local connection
when we are not associated with an XA transaction.
|
javax.transaction.xa.XAResource |
getXAResource() |
private boolean |
isGlobal()
Check if this connection is part of a global XA transaction.
|
boolean |
isInGlobalTransaction()
Is this a global transaction
|
java.sql.CallableStatement |
wrapStatement(java.sql.CallableStatement cs,
java.lang.String sql)
Wrap and control a PreparedStatement
|
java.sql.PreparedStatement |
wrapStatement(java.sql.PreparedStatement ps,
java.lang.String sql,
java.lang.Object generatedKeys)
Wrap and control a PreparedStatement
|
java.sql.Statement |
wrapStatement(java.sql.Statement s)
Wrap and control a Statement
|
addConnectionEventListener, addStatementEventListener, checkActive, close, closingConnection, getLanguageConnection, getNewCurrentConnectionHandle, getPassword, getUsername, isActive, isIsolationLevelSetUsingSQLorJDBC, notifyError, notifyException, onStatementClose, onStatementErrorOccurred, openRealConnection, removeConnectionEventListener, removeStatementEventListener, resetIsolationLevelFlag, resetRealConnection, toString
private EmbedXAResource xaRes
EmbedXAConnection(BasicEmbeddedDataSource40 ds, ResourceAdapter ra, java.lang.String u, java.lang.String p, boolean requestPassword) throws java.sql.SQLException
java.sql.SQLException
public boolean isInGlobalTransaction()
BrokeredConnectionControl
isInGlobalTransaction
in interface BrokeredConnectionControl
isInGlobalTransaction
in class EmbedPooledConnection
BrokeredConnectionControl.isInGlobalTransaction()
private boolean isGlobal()
true
if the transaction is global, false
if the
transaction is localpublic final javax.transaction.xa.XAResource getXAResource() throws java.sql.SQLException
getXAResource
in interface javax.sql.XAConnection
java.sql.SQLException
public void checkAutoCommit(boolean autoCommit) throws java.sql.SQLException
checkAutoCommit
in interface BrokeredConnectionControl
checkAutoCommit
in class EmbedPooledConnection
java.sql.SQLException
public int checkHoldCursors(int holdability, boolean downgrade) throws java.sql.SQLException
checkHoldCursors
in interface BrokeredConnectionControl
checkHoldCursors
in class EmbedPooledConnection
downgrade
- true to downgrade the holdability,
false to throw an exception.java.sql.SQLException
public void checkSavepoint() throws java.sql.SQLException
checkSavepoint
in interface BrokeredConnectionControl
checkSavepoint
in class EmbedPooledConnection
java.sql.SQLException
public void checkRollback() throws java.sql.SQLException
checkRollback
in interface BrokeredConnectionControl
checkRollback
in class EmbedPooledConnection
java.sql.SQLException
public void checkCommit() throws java.sql.SQLException
checkCommit
in interface BrokeredConnectionControl
checkCommit
in class EmbedPooledConnection
java.sql.SQLException
public void checkClose() throws java.sql.SQLException
BrokeredConnectionControl
checkClose
in interface BrokeredConnectionControl
checkClose
in class EmbedPooledConnection
java.sql.SQLException
- if it is not allowed to call close on the brokered
connectionBrokeredConnectionControl.checkClose()
public java.sql.Connection getConnection() throws java.sql.SQLException
EmbedPooledConnection
getConnection
in interface javax.sql.PooledConnection
getConnection
in class EmbedPooledConnection
java.sql.SQLException
- - if a database-access error occurs.public java.sql.Statement wrapStatement(java.sql.Statement s) throws java.sql.SQLException
wrapStatement
in interface BrokeredConnectionControl
wrapStatement
in class EmbedPooledConnection
java.sql.SQLException
public java.sql.PreparedStatement wrapStatement(java.sql.PreparedStatement ps, java.lang.String sql, java.lang.Object generatedKeys) throws java.sql.SQLException
wrapStatement
in interface BrokeredConnectionControl
wrapStatement
in class EmbedPooledConnection
ps
- PreparedStatment to be wrappedsql
- StringgeneratedKeys
- Objectjava.sql.SQLException
public java.sql.CallableStatement wrapStatement(java.sql.CallableStatement cs, java.lang.String sql) throws java.sql.SQLException
wrapStatement
in interface BrokeredConnectionControl
wrapStatement
in class EmbedPooledConnection
cs
- CallableStatment to be wrappedsql
- Stringjava.sql.SQLException
public EngineConnection getRealConnection() throws java.sql.SQLException
getRealConnection
in interface BrokeredConnectionControl
getRealConnection
in class EmbedPooledConnection
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.