SQLServerXADataSource Class

Implements

javax.sql.XADataSource

public final class SQLServerXADataSource
extends SQLServerConnectionPoolDataSource
implements javax.sql.XADataSource

Provides database connections for use in distributed (XA) transactions. SQLServerXADataSource also supports connection pooling of physical connections. The XADataSource and XAConnection interfaces, which are defined in the package javax.sql, are implemented by sqlserver. An XAConnection object is a pooled connection that can participate in a distributed transaction. More precisely, XAConnection extends the PooledConnection interface by adding the method getXAResource. This method produces an XAResource object that can be used by a transaction manager to coordinate the work done on this connection with the other participants in the distributed transaction.

Because they extend the PooledConnection interface, XAConnection objects support all the methods of PooledConnection objects. They are reusable physical connections to an underlying data source and produce logical connection handles that can be passed back to a JDBC application.

XAConnection objects are produced by an XADataSource object. There is some similarity between ConnectionPoolDataSource objects and XADataSource objects in that they are both implemented below a DataSource layer that is visible to the JDBC application. This architecture allows sqlserver to support distributed transactions in a way that is transparent to the application.

SQLServerXADataSource can be configured to integrate with Microsoft Distributed Transaction Coordinator (DTC) to provide true, distributed transaction processing.

Constructor Summary

Constructor Description
SQLServerXADataSource()

default constructor

Method Summary

Modifier and Type Method and Description
javax.naming.Reference getReference()
javax.sql.XAConnection getXAConnection()

Returns a physical database connection to particate in an XA transaction.

javax.sql.XAConnection getXAConnection(String user, String password)

Returns a physical database connection to particate in an XA transaction with the specified user and password.

Methods inherited from SQLServerConnectionPoolDataSource

Methods inherited from SQLServerDataSource

<T>unwrap getAADSecurePrincipalId getAccessToken getAccessTokenCallback getAccessTokenCallbackClass getApplicationIntent getApplicationName getAuthentication getCalcBigDecimalPrecision getCancelQueryTimeout getClientCertificate getClientKey getColumnEncryptionSetting getConnectRetryCount getConnectRetryInterval getConnection getConnection getDatabaseName getDatetimeParameterType getDelayLoadingLobs getDescription getDisableStatementPooling getDomain getEnablePrepareOnFirstPreparedStatementCall getEnclaveAttestationProtocol getEnclaveAttestationUrl getEncrypt getFIPS getFailoverPartner getGSSCredentials getHostNameInCertificate getIPAddressPreference getInstanceName getJAASConfigurationName getJASSConfigurationName getKeyStoreAuthentication getKeyStoreLocation getKeyStorePrincipalId getKeyVaultProviderClientId getLastUpdateCount getLockTimeout getLogWriter getLoginTimeout getMSIClientId getMaxResultBuffer getMsiTokenCacheTtl getMultiSubnetFailover getPacketSize getParentLogger getPortNumber getPrepareMethod getQueryTimeout getRealm getReplication getResponseBuffering getSSLProtocol getSelectMethod getSendStringParametersAsUnicode getSendTemporalDataTypesAsStringForBulkCopy getSendTimeAsDatetime getServerCertificate getServerName getServerNameAsACE getServerPreparedStatementDiscardThreshold getServerSpn getSocketFactoryClass getSocketFactoryConstructorArg getSocketTimeout getStatementPoolingCacheSize getTransparentNetworkIPResolution getTrustManagerClass getTrustManagerConstructorArg getTrustServerCertificate getTrustStore getTrustStoreType getURL getUseBulkCopyForBatchInsert getUseDefaultGSSCredential getUseDefaultJaasConfig getUseFlexibleCallableStatements getUseFmtOnly getUser getWorkstationID getXopenStates getcacheBulkCopyMetadata com.microsoft.sqlserver.jdbc.SQLServerDataSource.isWrapperFor(java.lang.Class< setAADSecurePrincipalId setAADSecurePrincipalSecret setAccessToken setAccessTokenCallback setAccessTokenCallbackClass setApplicationIntent setApplicationName setAuthentication setAuthenticationScheme setCalcBigDecimalPrecision setCancelQueryTimeout setClientCertificate setClientKey setClientKeyPassword setColumnEncryptionSetting setConnectRetryCount setConnectRetryInterval setDatabaseName setDatetimeParameterType setDelayLoadingLobs setDescription setDisableStatementPooling setDomain setEnablePrepareOnFirstPreparedStatementCall setEnclaveAttestationProtocol setEnclaveAttestationUrl setEncrypt setEncrypt setFIPS setFailoverPartner setGSSCredentials setHostNameInCertificate setIPAddressPreference setInstanceName setIntegratedSecurity setJAASConfigurationName setJASSConfigurationName setKeyStoreAuthentication setKeyStoreLocation setKeyStorePrincipalId setKeyStoreSecret setKeyVaultProviderClientId setKeyVaultProviderClientKey setLastUpdateCount setLockTimeout setLogWriter setLoginTimeout setMSIClientId setMaxResultBuffer setMsiTokenCacheTtl setMultiSubnetFailover setPacketSize setPassword setPortNumber setPrepareMethod setQueryTimeout setRealm setReplication setResponseBuffering setSSLProtocol setSelectMethod setSendStringParametersAsUnicode setSendTemporalDataTypesAsStringForBulkCopy setSendTimeAsDatetime setServerCertificate setServerName setServerNameAsACE setServerPreparedStatementDiscardThreshold setServerSpn setSocketFactoryClass setSocketFactoryConstructorArg setSocketTimeout setStatementPoolingCacheSize setTransparentNetworkIPResolution setTrustManagerClass setTrustManagerConstructorArg setTrustServerCertificate setTrustStore setTrustStorePassword setTrustStoreType setURL setUseBulkCopyForBatchInsert setUseDefaultGSSCredential setUseDefaultJaasConfig setUseFlexibleCallableStatements setUseFmtOnly setUser setWorkstationID setXopenStates setcacheBulkCopyMetadata toString

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

SQLServerXADataSource

public SQLServerXADataSource()

default constructor

Method Details

getReference

public Reference getReference()

Overrides:

SQLServerXADataSource.getReference()

getXAConnection

public XAConnection getXAConnection()

Returns a physical database connection to particate in an XA transaction. This API should only be called by XA connection pool implementations, not regular JDBC application code.

Returns:

A new XAConnection

Throws:

java.sql.SQLException

getXAConnection

public XAConnection getXAConnection(String user, String password)

Returns a physical database connection to particate in an XA transaction with the specified user and password. This API should only be called by XA connection pool implementations, not regular JDBC application code.

Parameters:

user
password

Returns:

A new XAConnection

Throws:

java.sql.SQLException

Applies to