org.postgresql.xa
Class PGXADataSource

java.lang.Object
  extended by org.postgresql.ds.common.BaseDataSource
      extended by org.postgresql.xa.PGXADataSource
All Implemented Interfaces:
Referenceable, CommonDataSource, XADataSource

public class PGXADataSource
extends BaseDataSource
implements XADataSource

XA-enabled DataSource implementation.

Author:
Heikki Linnakangas ([email protected])

Constructor Summary
PGXADataSource()
           
 
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
getAllowEncodingChanges, getApplicationName, getAssumeMinServerVersion, getAutosave, getBinaryTransfer, getBinaryTransferDisable, getBinaryTransferEnable, getCancelSignalTimeout, getConnection, getConnection, getConnectTimeout, getCurrentSchema, getDatabaseMetadataCacheFields, getDatabaseMetadataCacheFieldsMiB, getDatabaseName, getDefaultRowFetchSize, getDisableColumnSanitiser, getGssLib, getHostRecheckSeconds, getJaasApplicationName, getKerberosServerName, getLoadBalanceHosts, getLoggerFile, getLoggerLevel, getLoginTimeout, getLogUnclosedConnections, getLogWriter, getPassword, getPortNumber, getPreferQueryMode, getPreparedStatementCacheQueries, getPreparedStatementCacheSizeMiB, getPrepareThreshold, getProperty, getProperty, getProtocolVersion, getReadOnly, getReceiveBufferSize, getReference, getReplication, getReWriteBatchedInserts, getSendBufferSize, getServerName, getSocketFactory, getSocketFactoryArg, getSocketTimeout, getSsl, getSslCert, getSslfactory, getSslFactoryArg, getSslHostnameVerifier, getSslKey, getSslMode, getSslPassword, getSslPasswordCallback, getSslRootCert, getSspiServiceClass, getStringType, getTargetServerType, getTcpKeepAlive, getUnknownLength, getUrl, getUser, getUseSpNego, initializeFrom, isColumnSanitiserDisabled, readBaseObject, setAllowEncodingChanges, setApplicationName, setAssumeMinServerVersion, setAutosave, setBinaryTransfer, setBinaryTransferDisable, setBinaryTransferEnable, setCancelSignalTimeout, setConnectTimeout, setCurrentSchema, setDatabaseMetadataCacheFields, setDatabaseMetadataCacheFieldsMiB, setDatabaseName, setDefaultRowFetchSize, setDisableColumnSanitiser, setFromReference, setGssLib, setHostRecheckSeconds, setJaasApplicationName, setKerberosServerName, setLoadBalanceHosts, setLoggerFile, setLoggerLevel, setLoginTimeout, setLogUnclosedConnections, setLogWriter, setPassword, setPortNumber, setPreferQueryMode, setPreparedStatementCacheQueries, setPreparedStatementCacheSizeMiB, setPrepareThreshold, setProperty, setProperty, setProtocolVersion, setReadOnly, setReceiveBufferSize, setReplication, setReWriteBatchedInserts, setSendBufferSize, setServerName, setSocketFactory, setSocketFactoryArg, setSocketTimeout, setSsl, setSslCert, setSslfactory, setSslFactoryArg, setSslHostnameVerifier, setSslKey, setSslMode, setSslPassword, setSslPasswordCallback, setSslRootCert, setSspiServiceClass, setStringType, setTargetServerType, setTcpKeepAlive, setUnknownLength, setUrl, setUser, setUseSpNego, writeBaseObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sql.CommonDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Constructor Detail

PGXADataSource

public PGXADataSource()
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.

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
Returns:
description of this DataSource-ish thing

createReference

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

Overrides:
createReference in class BaseDataSource
Returns:
reference using the appropriate object factory


Copyright © 2017 PostgreSQL Global Development Group. All rights reserved.