--- title: "getXAConnection Method () | Microsoft Docs" ms.custom: "" ms.date: "01/19/2017" ms.prod: sql ms.prod_service: connectivity ms.reviewer: "" ms.technology: connectivity ms.topic: conceptual apiname: - "SQLServerXADataSource.getXAConnection ()" apilocation: - "sqljdbc.jar" apitype: "Assembly" ms.assetid: b2710613-78b1-438f-b996-c7ae6f34381a author: David-Engel ms.author: v-daenge --- # getXAConnection Method () [!INCLUDE[Driver_JDBC_Download](../../../includes/driver_jdbc_download.md)] Tries to establish a physical database connection that can be used in a distributed transaction. ## Syntax ``` public javax.sql.XAConnection getXAConnection() ``` ## Return Value An XAConnection object. ## Exceptions java.sql.SQLException ## Remarks This getXAConnection method is specified by the getXAConnection method in the javax.sql.XADataSource interface. > [!NOTE] > This method is typically called by XA connection pool implementations and not by regular JDBC application code. ## See Also [getXAConnection Method (SQLServerXADataSource)](../../../connect/jdbc/reference/getxaconnection-method-sqlserverxadatasource.md) [SQLServerXADataSource Methods](../../../connect/jdbc/reference/sqlserverxadatasource-methods.md) [SQLServerXADataSource Members](../../../connect/jdbc/reference/sqlserverxadatasource-members.md) [SQLServerXADataSource Class](../../../connect/jdbc/reference/sqlserverxadatasource-class.md)