com.amazon.redshift.xa

## Class RedshiftXADataSource

- java.lang.Object
- - com.amazon.redshift.ds.common.BaseDataSource
  - - com.amazon.redshift.xa.RedshiftXADataSource

All Implemented Interfaces:
  Referenceable, CommonDataSource, XADataSource

    public class RedshiftXADataSource
    extends BaseDataSource
    implements XADataSource

XA-enabled DataSource implementation.

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

### Constructor Summary

Constructors
Constructor and Description
`RedshiftXADataSource()`

### Method Summary

Methods
`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 Redshift database.
`XAConnection` `getXAConnection(String user, String password)` Gets a XA-enabled connection to the Redshift database.

### Methods inherited from class com.amazon.redshift.ds.common.BaseDataSource

`getAllowEncodingChanges, getApplicationName, getAssumeMinServerVersion, getAutosave, getBinaryTransfer, getBinaryTransferDisable, getBinaryTransferEnable, getCancelSignalTimeout, getCleanupSavepoints, getConnection, getConnection, getConnectTimeout, getCurrentSchema, getDatabaseMetadataCacheFields, getDatabaseMetadataCacheFieldsMiB, getDatabaseName, getDefaultRowFetchSize, getDisableColumnSanitiser, getEscapeSyntaxCallMode, getGssLib, getHideUnprivilegedObjects, getHostRecheckSeconds, getJaasApplicationName, getJaasLogin, getKerberosServerName, getLoadBalanceHosts, getLogDirectory, getLoginTimeout, getLogLevel, getLogServerErrorDetail, getLogUnclosedConnections, getLogWriter, getMaxResultBuffer, getOptions, getParentLogger, getPassword, getPortNumber, getPortNumbers, getPreferQueryMode, getPreparedStatementCacheQueries, getPreparedStatementCacheSizeMiB, getPrepareThreshold, getProperty, getProperty, getProtocolVersion, 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, getSslrootcert, getSslRootCert, getSspiServiceClass, getStringType, getTargetServerType, getTcpKeepAlive, getUnknownLength, getUrl, getURL, getUser, getUserID, getUseSpNego, initializeFrom, isAllowEncodingChanges, isCleanupSavePoints, isColumnSanitiserDisabled, isDisableColumnSanitiser, isLoadBalanceHosts, isLogUnclosedConnections, isRaiseExceptionOnSilentRollback, isReadOnly, isReWriteBatchedInserts, isSsl, isTcpKeepAlive, readBaseObject, setAllowEncodingChanges, setApplicationName, setAssumeMinServerVersion, setAutosave, setBinaryTransfer, setBinaryTransferDisable, setBinaryTransferEnable, setCancelSignalTimeout, setCleanupSavepoints, setCleanupSavePoints, setConnectTimeout, setCurrentSchema, setDatabaseMetadataCacheFields, setDatabaseMetadataCacheFieldsMiB, setDatabaseName, setDefaultRowFetchSize, setDisableColumnSanitiser, setEscapeSyntaxCallMode, setFromReference, setGssLib, setHideUnprivilegedObjects, setHostRecheckSeconds, setJaasApplicationName, setJaasLogin, setKerberosServerName, setLoadBalanceHosts, setLogDirectory, setLoginTimeout, setLogLevel, setLogServerErrorDetail, setLogUnclosedConnections, setLogWriter, setMaxResultBuffer, setOptions, setPassword, setPortNumber, setPortNumbers, setPreferQueryMode, setPreparedStatementCacheQueries, setPreparedStatementCacheSizeMiB, setPrepareThreshold, setProperty, setProperty, setProtocolVersion, setRaiseExceptionOnSilentRollback, 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, setSslrootcert, setSslRootCert, setSspiServiceClass, setStringType, setTargetServerType, setTcpKeepAlive, setUnknownLength, setUrl, setURL, setUser, setUserID, 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, getParentLogger, setLoginTimeout, setLogWriter`

### Constructor Detail

#### RedshiftXADataSource

    public RedshiftXADataSource()

### Method Detail

#### getXAConnection

    public XAConnection getXAConnection()
                                 throws SQLException

Gets a connection to the Redshift 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 Redshift 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