Module org.hsqldb

Class JDBCXADataSource

  • All Implemented Interfaces:
    java.io.Serializable, javax.naming.Referenceable, javax.sql.CommonDataSource, javax.sql.XADataSource

    public class JDBCXADataSource
    extends JDBCCommonDataSource
    implements javax.sql.XADataSource, java.io.Serializable, javax.naming.Referenceable, javax.sql.CommonDataSource
    Connection factory for JDBCXAConnections. For use by XA data source factories, not by end users.

    The JDBCDataSourceFactory can be used to get instances of this class.

    The methods of the superclass, JDBCCommonDataSource, are used for settings the HyperSQL server and user.

    Since:
    HSQLDB 2.0.0
    Author:
    Blaine Simpson (blaine dot simpson at admc dot com)
    See Also:
    XADataSource, JDBCXAConnection, Serialized Form
    • Constructor Detail

      • JDBCXADataSource

        public JDBCXADataSource()
                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException
    • Method Detail

      • getXAConnection

        public javax.sql.XAConnection getXAConnection()
                                               throws java.sql.SQLException
        Get new XAConnection connection, to be managed by a connection manager.
        Specified by:
        getXAConnection in interface javax.sql.XADataSource
        Throws:
        java.sql.SQLException - on error
      • getXAConnection

        public javax.sql.XAConnection getXAConnection​(java.lang.String user,
                                                      java.lang.String password)
                                               throws java.sql.SQLException
        Gets a new XAConnection after validating the given username and password.
        Specified by:
        getXAConnection in interface javax.sql.XADataSource
        Parameters:
        user - String which must match the 'user' configured for this JDBCXADataSource.
        password - String which must match the 'password' configured for this JDBCXADataSource.
        Throws:
        java.sql.SQLException - on error
        See Also:
        getXAConnection()
      • getReference

        public javax.naming.Reference getReference()
                                            throws javax.naming.NamingException
        Retrieves the Reference of this object.
        Specified by:
        getReference in interface javax.naming.Referenceable
        Returns:
        The non-null javax.naming.Reference of this object.
        Throws:
        javax.naming.NamingException - If a naming exception was encountered while retrieving the reference.
      • addResource

        public void addResource​(javax.transaction.xa.Xid xid,
                                JDBCXAResource xaResource)
      • removeResource

        public JDBCXAResource removeResource​(javax.transaction.xa.Xid xid)