org.hsqldb.jdbc.pool
Class JDBCXAConnection

java.lang.Object
  extended by org.hsqldb.jdbc.pool.JDBCPooledConnection
      extended by org.hsqldb.jdbc.pool.JDBCXAConnection
All Implemented Interfaces:
PooledConnection, XAConnection, JDBCConnectionEventListener

public class JDBCXAConnection
extends JDBCPooledConnection
implements 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
JDBCXAConnection(JDBCXADataSource dataSource, JDBCConnection connection)
           
 
Method Summary
 void close()
           
 Connection getConnection()
          Returns a connection that can be used by the user application.
 XAResource getXAResource()
           
 
Methods inherited from class org.hsqldb.jdbc.pool.JDBCPooledConnection
addConnectionEventListener, addStatementEventListener, connectionClosed, connectionErrorOccurred, isInUse, release, removeConnectionEventListener, removeStatementEventListener, reset
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sql.PooledConnection
addConnectionEventListener, addStatementEventListener, removeConnectionEventListener, removeStatementEventListener
 

Constructor Detail

JDBCXAConnection

public JDBCXAConnection(JDBCXADataSource dataSource,
                        JDBCConnection connection)
Method Detail

getXAResource

public XAResource getXAResource()
                         throws SQLException
Specified by:
getXAResource in interface XAConnection
Throws:
SQLException

getConnection

public Connection getConnection()
                         throws SQLException
Returns a connection that can be used by the user application.

Specified by:
getConnection in interface PooledConnection
Overrides:
getConnection in class JDBCPooledConnection
Returns:
Connection
Throws:
SQLException - if a lease has already been given on this connection

close

public void close()
           throws SQLException
Specified by:
close in interface PooledConnection
Overrides:
close in class JDBCPooledConnection
Throws:
SQLException


Copyright © 2001 - 2017 HSQL Development Group.