Package org.apache.derby.client.net
Class NetXAConnection
- java.lang.Object
-
- org.apache.derby.client.net.NetXAConnection
-
public class NetXAConnection extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private NetConnection
netCon
-
Constructor Summary
Constructors Constructor Description NetXAConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc)
The construcor for the NetXAConnection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkPlatformVersion()
private NetConnection
createNetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc)
Creates NetConnection for the supported version of jdbc.NetConnection
getNetConnection()
Returns underlying net connection(package private) void
readCommit()
private void
readLocalXACommit_()
private void
readLocalXARollback_()
(package private) void
readRollback()
void
setCorrelatorToken(byte[] crttoken)
(package private) void
setNetXAResource(NetXAResource xares)
(package private) void
writeCommit()
private void
writeLocalXACommit_()
private void
writeLocalXARollback_()
(package private) void
writeRollback()
(package private) void
writeTransactionStart(ClientStatement statement)
-
-
-
Field Detail
-
netCon
private NetConnection netCon
-
-
Constructor Detail
-
NetXAConnection
public NetXAConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc) throws SqlException
The construcor for the NetXAConnection. The parameter is set tothis
from ClientXAConnection when it creates an instance of NetXAConnection. This is then passed on the underlying NetConnection constructor and is used to raise StatementEvents from any PreparedStatement that would be created from that NetConnection.- Parameters:
logWriter
- LogWriter object associated with this connectionuser
- user id for this connectionpassword
- password for this connectiondataSource
- The DataSource object passed from the ClientXAConnection object from which this constructor was calledrmId
- The Resource manager ID for XA ConnectionsisXAConn
- true if this is a XA connectioncpc
- The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object- Throws:
SqlException
-
-
Method Detail
-
setCorrelatorToken
public void setCorrelatorToken(byte[] crttoken)
-
setNetXAResource
void setNetXAResource(NetXAResource xares)
-
writeLocalXACommit_
private void writeLocalXACommit_() throws SqlException
- Throws:
SqlException
-
readLocalXACommit_
private void readLocalXACommit_() throws SqlException
- Throws:
SqlException
-
writeLocalXARollback_
private void writeLocalXARollback_() throws SqlException
- Throws:
SqlException
-
readLocalXARollback_
private void readLocalXARollback_() throws SqlException
- Throws:
SqlException
-
writeTransactionStart
void writeTransactionStart(ClientStatement statement) throws SqlException
- Throws:
SqlException
-
writeCommit
void writeCommit() throws SqlException
- Throws:
SqlException
-
readCommit
void readCommit() throws SqlException
- Throws:
SqlException
-
writeRollback
void writeRollback() throws SqlException
- Throws:
SqlException
-
readRollback
void readRollback() throws SqlException
- Throws:
SqlException
-
getNetConnection
public NetConnection getNetConnection()
Returns underlying net connection- Returns:
- NetConnection
-
checkPlatformVersion
private void checkPlatformVersion() throws SqlException
- Throws:
SqlException
-
createNetConnection
private NetConnection createNetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc) throws SqlException
Creates NetConnection for the supported version of jdbc. This method can be overwritten to return NetConnection of the supported jdbc version.- Parameters:
logWriter
- LogWriter object associated with this connectionuser
- user id for this connectionpassword
- password for this connectiondataSource
- The DataSource object passed from the ClientXAConnection object from which this constructor was calledrmId
- The Resource manager ID for XA ConnectionsisXAConn
- true if this is a XA connectioncpc
- The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object- Returns:
- NetConnection
- Throws:
SqlException
-
-