org.postgresql.xa.jdbc3
Class AbstractJdbc3XADataSource

java.lang.Object
  extended by org.postgresql.ds.common.BaseDataSource
      extended by org.postgresql.xa.jdbc3.AbstractJdbc3XADataSource
All Implemented Interfaces:
Referenceable
Direct Known Subclasses:
AbstractJdbc4XADataSource

public class AbstractJdbc3XADataSource
extends BaseDataSource
implements Referenceable

XA-enabled DataSource implementation.

Author:
Heikki Linnakangas (heikki.linnakangas@iki.fi)

Constructor Summary
AbstractJdbc3XADataSource()
           
 
Method Summary
protected  Reference createReference()
          Generates a reference using the appropriate object factory.
 String getDescription()
          Gets a description of this DataSource-ish thing.
 XAConnection getXAConnection()
          Gets a connection to the PostgreSQL database.
 XAConnection getXAConnection(String user, String password)
          Gets a XA-enabled connection to the PostgreSQL database.
 
Methods inherited from class org.postgresql.ds.common.BaseDataSource
getApplicationName, getCompatible, getConnection, getConnection, getDatabaseName, getLoginTimeout, getLogLevel, getLogWriter, getPassword, getPortNumber, getPrepareThreshold, getProtocolVersion, getReference, getServerName, getSocketTimeout, getSsl, getSslfactory, getTcpKeepAlive, getUnknownLength, getUser, initializeFrom, readBaseObject, setApplicationName, setCompatible, setDatabaseName, setLoginTimeout, setLogLevel, setLogWriter, setPassword, setPortNumber, setPrepareThreshold, setProtocolVersion, setServerName, setSocketTimeout, setSsl, setSslfactory, setTcpKeepAlive, setUnknownLength, setUser, writeBaseObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.naming.Referenceable
getReference
 

Constructor Detail

AbstractJdbc3XADataSource

public AbstractJdbc3XADataSource()
Method Detail

getXAConnection

public XAConnection getXAConnection()
                             throws 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.

Returns:
A valid database connection.
Throws:
SQLException - Occurs when the database connection cannot be established.

getXAConnection

public XAConnection getXAConnection(String user,
                                    String password)
                             throws 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.

Returns:
A valid database connection.
Throws:
SQLException - Occurs when the database connection cannot be established.

getDescription

public 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

createReference

protected Reference createReference()
Generates a reference using the appropriate object factory.

Overrides:
createReference in class BaseDataSource


Copyright © 2013. All Rights Reserved.