Class PGXADataSource

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

    public class PGXADataSource
    extends BaseDataSource
    implements javax.sql.XADataSource
    XA-enabled DataSource implementation.
    Author:
    Heikki Linnakangas (heikki.linnakangas@iki.fi)
    • Constructor Detail

      • PGXADataSource

        public PGXADataSource()
    • Method Detail

      • getXAConnection

        public javax.sql.XAConnection getXAConnection()
                                               throws java.sql.SQLException
        Gets a connection to the PostgreSQL database. The database is identified by the DataSource properties serverName, databaseName, and portNumber. The user to connect as is identified by the DataSource properties user and password.
        Specified by:
        getXAConnection in interface javax.sql.XADataSource
        Returns:
        A valid database connection.
        Throws:
        java.sql.SQLException - Occurs when the database connection cannot be established.
      • getXAConnection

        public javax.sql.XAConnection getXAConnection​(java.lang.String user,
                                                      java.lang.String password)
                                               throws java.sql.SQLException
        Gets a XA-enabled connection to the PostgreSQL database. The database is identified by the DataSource properties serverName, databaseName, and portNumber. The user to connect as is identified by the arguments user and password, which override the DataSource properties by the same name.
        Specified by:
        getXAConnection in interface javax.sql.XADataSource
        Returns:
        A valid database connection.
        Throws:
        java.sql.SQLException - Occurs when the database connection cannot be established.
      • getDescription

        public java.lang.String getDescription()
        Description copied from class: BaseDataSource
        Gets a description of this DataSource-ish thing. Must be customized by subclasses.
        Specified by:
        getDescription in class BaseDataSource
        Returns:
        description of this DataSource-ish thing
      • createReference

        protected javax.naming.Reference createReference()
        Generates a reference using the appropriate object factory.
        Overrides:
        createReference in class BaseDataSource
        Returns:
        reference using the appropriate object factory