org.postgresql.xa
Class PGXADataSource
java.lang.Object
org.postgresql.ds.common.BaseDataSource
org.postgresql.xa.PGXADataSource
- All Implemented Interfaces:
- Referenceable, CommonDataSource, XADataSource
public class PGXADataSource
- extends BaseDataSource
- implements Referenceable, XADataSource
XA-enabled DataSource implementation.
- Author:
- Heikki Linnakangas (heikki.linnakangas@iki.fi)
Methods inherited from class org.postgresql.ds.common.BaseDataSource |
getCompatible, getConnection, getConnection, getDatabaseName, getLoginTimeout, getLogWriter, getPassword, getPortNumber, getPrepareThreshold, getReference, getServerName, getSocketTimeout, getSsl, getSslfactory, getTcpKeepAlive, getUnknownLength, getUser, initializeFrom, readBaseObject, setCompatible, setDatabaseName, setLoginTimeout, setLogWriter, setPassword, setPortNumber, setPrepareThreshold, 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 |
PGXADataSource
public PGXADataSource()
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.
- Specified by:
getXAConnection
in interface XADataSource
- 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.
- Specified by:
getXAConnection
in interface XADataSource
- 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