multiSubnetFailover enables faster failover for all Availability Groups and failover cluster instances in SQL Server 2012 (11.x) and will significantly reduce failover time for single and multi-subnet AlwaysOn topologies. Connecting with multiSubnetFailoverĪlways specify multiSubnetFailover=true when connecting to the availability group listener of a SQL Server 2012 (11.x) availability group or a SQL Server 2012 (11.x) Failover Cluster Instance. Also, because a connection can fail because of an availability group failover, you should implement connection retry logic, retrying a failed connection until it reconnects. Increasing connection timeout and implementing connection retry logic will increase the probability that an application will connect to an availability group. Rest of the connection attempts follow the same logic as in the multiSubnetFailover feature. When transparentNetworkIPResolution is true, the first connection attempt uses a timeout value of 500 ms.transparentNetworkIPResolution is ignored if there are more than 64 IP addresses.transparentNetworkIPResolution is ignored if database mirroring is used.transparentNetworkIPResolution is ignored if multiSubnetFailover is true.transparentNetworkIPResolution is true by default.
If the first attempt fails, the driver tries to connect to all IP addresses in parallel until the timeout expires, discarding any pending connection attempts when one of them succeeds. When transparentNetworkIPResolution is true, the driver attempts to connect to the first IP address available.
For more details, see the sections below.īeginning in version 6.0 of the Microsoft JDBC Driver for SQL Server, a new connection property transparentNetworkIPResolution (TNIR) is added for transparent connection to Always On availability groups or to a server that has multiple IP addresses associated. Use applicationIntent to declare the application workload type. Specify multiSubnetFailover=true when connecting to the availability group listener of an availability group or a Failover Cluster Instance. The following connection properties were added in Microsoft JDBC Driver 4.0 for SQL Server: If a Microsoft JDBC Driver for SQL Server application is connected to an AlwaysOn database that fails over, the original connection is broken, and the application must open a new connection to continue work after the failover. For more information about Always On Availability Groups, see SQL Server 2012 (11.x) Books Online.īeginning in version 4.0 of the Microsoft JDBC Driver for SQL Server, you can specify the availability group listener of a (high-availability, disaster-recovery) availability group (AG) in the connection property. Step 3: Proof of concept connecting to SQL using Javaįeedback and finding additional JDBC driver information Downloadĭownload Microsoft JDBC Driver for SQL Server - has additional information about Maven projects, and more.This article discusses Microsoft JDBC Driver for SQL Server support for high-availability, disaster recovery: Always On Availability Groups.Step 2: Create a SQL database for Java development.Step 1: Configure development environment for Java development.The Microsoft JDBC Driver for SQL Server has been tested against major application servers such as IBM WebSphere and SAP NetWeaver. This driver is a Type 4 JDBC driver that provides database connectivity through the standard JDBC application program interfaces (APIs). The driver is available at no extra charge and provides Java database connectivity from any Java application, application server, or Java-enabled applet. In our continued commitment to interoperability, Microsoft provides a Java Database Connectivity (JDBC) driver for use with SQL Server, Azure SQL Database, and Azure SQL Managed Instance.