Package net.sourceforge.jtds.jdbcx
Class JtdsXAConnection
- java.lang.Object
-
- net.sourceforge.jtds.jdbcx.PooledConnection
-
- net.sourceforge.jtds.jdbcx.JtdsXAConnection
-
- All Implemented Interfaces:
javax.sql.PooledConnection,javax.sql.XAConnection
public class JtdsXAConnection extends PooledConnection implements javax.sql.XAConnection
jTDS implementation of theXAConnectioninterface.- Version:
- $Id: JtdsXAConnection.java,v 1.4 2005-04-28 14:29:30 alin_sinpalean Exp $
-
-
Field Summary
Fields Modifier and Type Field Description private JtdsDataSourcedataSourceprivate javax.transaction.xa.XAResourceresourceThe XAResource used by the transaction manager to control this connection.private intxaConnectionId-
Fields inherited from class net.sourceforge.jtds.jdbcx.PooledConnection
connection
-
-
Constructor Summary
Constructors Constructor Description JtdsXAConnection(JtdsDataSource dataSource, java.sql.Connection connection)Construct a newXAConnectionobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the database connection.(package private) intgetXAConnectionID()Retrieves the XA Connection ID to pass to server.protected JtdsDataSourcegetXADataSource()javax.transaction.xa.XAResourcegetXAResource()-
Methods inherited from class net.sourceforge.jtds.jdbcx.PooledConnection
addConnectionEventListener, addStatementEventListener, fireConnectionEvent, getConnection, removeConnectionEventListener, removeStatementEventListener
-
-
-
-
Field Detail
-
resource
private final javax.transaction.xa.XAResource resource
The XAResource used by the transaction manager to control this connection.
-
dataSource
private final JtdsDataSource dataSource
-
xaConnectionId
private final int xaConnectionId
-
-
Constructor Detail
-
JtdsXAConnection
public JtdsXAConnection(JtdsDataSource dataSource, java.sql.Connection connection) throws java.sql.SQLException
Construct a newXAConnectionobject.- Parameters:
dataSource- the parentDataSourceobjectconnection- the real database connection- Throws:
java.sql.SQLException
-
-
Method Detail
-
getXAConnectionID
int getXAConnectionID()
Retrieves the XA Connection ID to pass to server.- Returns:
- the XA connection ID as an
Integer
-
getXAResource
public javax.transaction.xa.XAResource getXAResource() throws java.sql.SQLException- Specified by:
getXAResourcein interfacejavax.sql.XAConnection- Throws:
java.sql.SQLException
-
close
public void close() throws java.sql.SQLExceptionDescription copied from class:PooledConnectionCloses the database connection.- Specified by:
closein interfacejavax.sql.PooledConnection- Overrides:
closein classPooledConnection- Throws:
java.sql.SQLException- if an error occurs
-
getXADataSource
protected JtdsDataSource getXADataSource()
-
-