Package org.postgresql.xa
Class PGXADataSource
java.lang.Object
org.postgresql.ds.common.BaseDataSource
org.postgresql.xa.PGXADataSource
- All Implemented Interfaces:
Referenceable
,CommonDataSource
,XADataSource
XA-enabled DataSource implementation.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Reference
Generates a reference using the appropriate object factory.Gets a description of this DataSource-ish thing.Gets a connection to the PostgreSQL database.getXAConnection
(@Nullable String user, @Nullable String password) Gets a XA-enabled connection to the PostgreSQL database.Methods inherited from class org.postgresql.ds.common.BaseDataSource
getAdaptiveFetch, getAdaptiveFetchMaximum, getAdaptiveFetchMinimum, getAllowEncodingChanges, getApplicationName, getAssumeMinServerVersion, getAuthenticationPluginClassName, getAutosave, getBinaryTransfer, getBinaryTransferDisable, getBinaryTransferEnable, getCancelSignalTimeout, getCleanupSavepoints, getConnection, getConnection, getConnectTimeout, getCurrentSchema, getDatabaseMetadataCacheFields, getDatabaseMetadataCacheFieldsMiB, getDatabaseName, getDefaultRowFetchSize, getDisableColumnSanitiser, getEscapeSyntaxCallMode, getGroupStartupParameters, getGssEncMode, getGssLib, getGssResponseTimeout, getHideUnprivilegedObjects, getHostRecheckSeconds, getJaasApplicationName, getJaasLogin, getKerberosServerName, getLoadBalanceHosts, getLocalSocketAddress, getLoggerFile, getLoggerLevel, getLoginTimeout, getLogServerErrorDetail, getLogUnclosedConnections, getLogWriter, getMaxResultBuffer, getOptions, getParentLogger, getPassword, getPortNumber, getPortNumbers, getPreferQueryMode, getPreparedStatementCacheQueries, getPreparedStatementCacheSizeMiB, getPrepareThreshold, getProperty, getProperty, getProtocolVersion, getQuoteReturningIdentifiers, getReadOnly, getReadOnlyMode, getReceiveBufferSize, getRecvBufferSize, getReference, getReplication, getReWriteBatchedInserts, getSendBufferSize, getServerName, getServerNames, getSocketFactory, getSocketFactoryArg, getSocketTimeout, getSsl, getSslcert, getSslCert, getSslfactory, getSslfactoryarg, getSslFactoryArg, getSslhostnameverifier, getSslHostnameVerifier, getSslkey, getSslKey, getSslmode, getSslMode, getSslpassword, getSslPassword, getSslpasswordcallback, getSslPasswordCallback, getSslResponseTimeout, getSslrootcert, getSslRootCert, getSspiServiceClass, getStringType, getTargetServerType, getTcpKeepAlive, getTcpNoDelay, getUnknownLength, getUrl, getURL, getUser, getUseSpNego, getXmlFactoryFactory, initializeFrom, isAllowEncodingChanges, isCleanupSavePoints, isColumnSanitiserDisabled, isDisableColumnSanitiser, isLoadBalanceHosts, isLogUnclosedConnections, isReadOnly, isReWriteBatchedInserts, isSsl, isTcpKeepAlive, readBaseObject, setAdaptiveFetch, setAdaptiveFetchMaximum, setAdaptiveFetchMinimum, setAllowEncodingChanges, setApplicationName, setAssumeMinServerVersion, setAuthenticationPluginClassName, setAutosave, setBinaryTransfer, setBinaryTransferDisable, setBinaryTransferEnable, setCancelSignalTimeout, setCleanupSavepoints, setCleanupSavePoints, setConnectTimeout, setCurrentSchema, setDatabaseMetadataCacheFields, setDatabaseMetadataCacheFieldsMiB, setDatabaseName, setDefaultRowFetchSize, setDisableColumnSanitiser, setEscapeSyntaxCallMode, setFromReference, setGroupStartupParameters, setGssEncMode, setGssLib, setGssResponseTimeout, setHideUnprivilegedObjects, setHostRecheckSeconds, setJaasApplicationName, setJaasLogin, setKerberosServerName, setLoadBalanceHosts, setLocalSocketAddress, setLoggerFile, setLoggerLevel, setLoginTimeout, setLogServerErrorDetail, setLogUnclosedConnections, setLogWriter, setMaxResultBuffer, setOptions, setPassword, setPortNumber, setPortNumbers, setPreferQueryMode, setPreparedStatementCacheQueries, setPreparedStatementCacheSizeMiB, setPrepareThreshold, setProperty, setProperty, setProtocolVersion, setQuoteReturningIdentifiers, setReadOnly, setReadOnlyMode, setReceiveBufferSize, setRecvBufferSize, setReplication, setReWriteBatchedInserts, setSendBufferSize, setServerName, setServerNames, setSocketFactory, setSocketFactoryArg, setSocketTimeout, setSsl, setSslcert, setSslCert, setSslfactory, setSslfactoryarg, setSslFactoryArg, setSslhostnameverifier, setSslHostnameVerifier, setSslkey, setSslKey, setSslmode, setSslMode, setSslpassword, setSslPassword, setSslpasswordcallback, setSslPasswordCallback, setSslResponseTimeout, setSslrootcert, setSslRootCert, setSspiServiceClass, setStringType, setTargetServerType, setTcpKeepAlive, setTcpNoDelay, setUnknownLength, setUrl, setURL, setUser, setUseSpNego, setXmlFactoryFactory, 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
createShardingKeyBuilder, getParentLogger
Methods inherited from interface javax.sql.XADataSource
createXAConnectionBuilder, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
-
Constructor Details
-
PGXADataSource
public PGXADataSource()
-
-
Method Details
-
getXAConnection
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 interfaceXADataSource
- Returns:
- A valid database connection.
- Throws:
SQLException
- Occurs when the database connection cannot be established.
-
getXAConnection
public XAConnection getXAConnection(@Nullable String user, @Nullable 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 interfaceXADataSource
- Returns:
- A valid database connection.
- Throws:
SQLException
- Occurs when the database connection cannot be established.
-
getDescription
Description copied from class:BaseDataSource
Gets a description of this DataSource-ish thing. Must be customized by subclasses.- Specified by:
getDescription
in classBaseDataSource
- Returns:
- description of this DataSource-ish thing
-
createReference
Generates a reference using the appropriate object factory.- Overrides:
createReference
in classBaseDataSource
- Returns:
- reference using the appropriate object factory
-