Bewerken

Delen via


SQLServerXADataSource Class

Download JDBC driver

Represents a factory for SQLServerXAConnection objects that is used internally.

Package: com.microsoft.sqlserver.jdbc

Extends: SQLServerConnectionPoolDataSource

Implements: javax.sql.XADataSource

Syntax

  
public class SQLServerXADataSource  

Remarks

An object that implements the SQLServerXADataSource interface is typically registered with a naming service that uses the Java Naming and Directory Interface (JNDI).

The SQLServerXADataSource class provides database connections for use in distributed (XA) transactions. The SQLServerXADataSource class also supports connection pooling of physical connections. The SQLServerXADataSource and SQLServerXAConnection interfaces, which are defined in the package javax.sql, are implemented by SQL Server.

A SQLServerXAConnection object is a pooled connection that can participate in a distributed transaction. More precisely, SQLServerXAConnection extends the SQLServerPooledConnection interface by adding the method getXAResource. This method produces a SQLServerXAResource 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 SQLServerPooledConnection interface, SQLServerXAConnection objects support all the methods of SQLServerPooledConnection 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.

SQLServerXAConnection objects are produced by a SQLServerXADataSource object. SQLServerConnectionPoolDataSource objects and SQLServerXADataSource objects are similar because they are both implemented below a data source layer that is visible to the JDBC application. This architecture lets SQL Server 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.

See Also

SQLServerXADataSource Members
JDBC Driver API Reference