- java.lang.Object
-
- org.hsqldb.jdbc.pool.JDBCPooledConnection
-
- org.hsqldb.jdbc.pool.JDBCXAConnection
-
- All Implemented Interfaces:
javax.sql.PooledConnection,javax.sql.XAConnection,JDBCConnectionEventListener
public class JDBCXAConnection extends JDBCPooledConnection implements javax.sql.XAConnection
Subclass of JDBCPooledConnection implements the XAConnection interface. For use by global transaction service managers.Each instance has an JDBCXAResource inherits the superclass's two JDBCConnection objects, one for internal access, and one for user access.
The getConnection() method returns a user connection and links this with the JDBCXAResource. This puts the object in the inUse state. When the user connection is closed, the object is put in the free state.
- Since:
- HSQLDB 2.0
- Author:
- Fred Toussi (fredt at users.sourceforge.net)
- See Also:
XAConnection
-
-
Constructor Summary
Constructors Constructor Description JDBCXAConnection(JDBCXADataSource dataSource, JDBCConnection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.sql.ConnectiongetConnection()Returns a connection that can be used by the user application.javax.transaction.xa.XAResourcegetXAResource()-
Methods inherited from class org.hsqldb.jdbc.pool.JDBCPooledConnection
addConnectionEventListener, addStatementEventListener, connectionClosed, connectionErrorOccurred, isInUse, release, removeConnectionEventListener, removeStatementEventListener, reset
-
-
-
-
Constructor Detail
-
JDBCXAConnection
public JDBCXAConnection(JDBCXADataSource dataSource, JDBCConnection connection)
-
-
Method Detail
-
getXAResource
public javax.transaction.xa.XAResource getXAResource() throws java.sql.SQLException- Specified by:
getXAResourcein interfacejavax.sql.XAConnection- Throws:
java.sql.SQLException
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLExceptionReturns a connection that can be used by the user application.- Specified by:
getConnectionin interfacejavax.sql.PooledConnection- Overrides:
getConnectionin classJDBCPooledConnection- Returns:
- Connection
- Throws:
java.sql.SQLException- if a lease has already been given on this connection
-
close
public void close() throws java.sql.SQLException- Specified by:
closein interfacejavax.sql.PooledConnection- Overrides:
closein classJDBCPooledConnection- Throws:
java.sql.SQLException
-
-