Skip to content

Commit 1aba0c6

Browse files
authored
Merge pull request #21117 from MicrosoftDocs/main
1/31 PM Publish
2 parents c4f7304 + 99799e6 commit 1aba0c6

8 files changed

Lines changed: 118 additions & 16 deletions
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Connection resiliency
3+
description: Connection resiliency can transparently restore broken idle connections. This feature improves application behavior when the server closes idle connections.
4+
ms.custom: ""
5+
ms.date: 01/30/2022
6+
ms.prod: sql
7+
ms.prod_service: connectivity
8+
ms.reviewer: ""
9+
ms.technology: connectivity
10+
ms.topic: conceptual
11+
author: David-Engel
12+
ms.author: v-davidengel
13+
---
14+
# Connection resiliency (JDBC)
15+
16+
[!INCLUDE[Driver_JDBC_Download](../../includes/driver_jdbc_download.md)]
17+
18+
Connection resiliency allows a broken idle connection to be reestablished, within limitations. If an initial connection fails, connection resiliency also allows the driver to automatically try to reconnect. Only SQL Server 2014 and later and Azure SQL Database support reconnecting a broken idle connection. This feature is available starting with Microsoft JDBC Driver 10.2.0 for SQL Server.
19+
20+
There are two aspects to connection resiliency. The first is the ability to transparently retry an initial database connection. The second is the ability to transparently restore an existing, idle connection. A typical idle connection might be a connection sitting in a connection pool. An "idle" connection is generally one that has been idle for at least 30 seconds. These connections often can be closed by the server or by network devices between the client and server.
21+
22+
The JDBC driver has two connection options that control connection resiliency behavior. These options can be added to the connection string or set via data source properties.
23+
24+
| Keyword | Values | Default | Description |
25+
|--|--|--|--|
26+
| `connectRetryCount` | Integer between 0 and 255 (inclusive) | 1 | The maximum number of attempts to establish or reestablish a connection before giving up. By default, a single retry attempt is made. A value of `0` means that a retry won't be attempted. |
27+
| `connectRetryInterval` | Integer between 1 and 60 (inclusive) | 10 | The time, in seconds, between connection retry attempts. The driver will attempt to reconnect immediately upon detecting a broken idle connection, and will then wait `connectRetryInterval` seconds before trying again. This keyword is ignored if `connectRetryCount` is 0. |
28+
29+
If the product of `connectRetryCount` multiplied by `connectRetryInterval` is larger than `loginTimeout`, then the driver will stop attempting to connect once `loginTimeout` is reached. Otherwise, it will continue to try to reconnect until `connectRetryCount` is reached.
30+
31+
To detect broken idle connections, the driver relies on TCP keepalive packets at the socket level. On Linux and Java 11+, the driver automatically enables keepalive packets at a 30-second interval (`KeepAliveTime`) with a 1-second delay between retries when a failure occurs (`KeepAliveInterval`).
32+
33+
> [!IMPORTANT]
34+
> On Windows and macOS or on Java 8, keepalives must be manually configured in the operating system in order to take advantage of restoring broken idle connections. For information on how to configure keepalives, see [Connection to Azure SQL database](connecting-to-an-azure-sql-database.md#connections-dropped).
35+
36+
## Limitations
37+
38+
Broken idle connections can't be restored when:
39+
40+
- There's an open result set that hasn't been completely parsed or buffered
41+
- Switching databases against Azure SQL
42+
- There's an open transaction
43+
44+
## See also
45+
46+
[Connecting to an Azure SQL database](connecting-to-an-azure-sql-database.md)
47+
[Technical Article - Idle Connection Resiliency](https://download.microsoft.com/download/D/2/0/D20E1C5F-72EA-4505-9F26-FEF9550EFD44/Idle%20Connection%20Resiliency.docx)
48+
[Overview of the JDBC driver](overview-of-the-jdbc-driver.md)

docs/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Download
33
description: Download the Microsoft JDBC Driver for SQL Server to develop Java applications that connect to SQL Server and Azure SQL Database.
4-
ms.date: 12/07/2021
4+
ms.date: 01/31/2022
55
ms.prod: sql
66
ms.prod_service: connectivity
77
ms.reviewer: ""
@@ -17,15 +17,15 @@ The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides d
1717

1818
## Download
1919

20-
Version 9.4 is the latest general availability (GA) version. It supports Java 8, 11, and 16. If you need to use an older Java runtime, see the [Java and JDBC specification support matrix](microsoft-jdbc-driver-for-sql-server-support-matrix.md#java-and-jdbc-specification-support) to see if there's a supported driver version you can use. We're continually improving Java connectivity support. As such we highly recommend that you work with the latest version of Microsoft JDBC driver.
20+
Version 10.2 is the latest general availability (GA) version. It supports Java 8, 11, and 17. If you need to use an older Java runtime, see the [Java and JDBC specification support matrix](microsoft-jdbc-driver-for-sql-server-support-matrix.md#java-and-jdbc-specification-support) to see if there's a supported driver version you can use. We're continually improving Java connectivity support. As such we highly recommend that you work with the latest version of Microsoft JDBC driver.
2121

22-
**[![Download](../../ssms/media/download-icon.png) Download Microsoft JDBC Driver 9.4 for SQL Server (zip)](https://go.microsoft.com/fwlink/?linkid=2183120)**
23-
**[![Download](../../ssms/media/download-icon.png) Download Microsoft JDBC Driver 9.4 for SQL Server (tar.gz)](https://go.microsoft.com/fwlink/?linkid=2183223)**
22+
**[![Download](../../ssms/media/download-icon.png) Download Microsoft JDBC Driver 10.2 for SQL Server (zip)](https://go.microsoft.com/fwlink/?linkid=2186163)**
23+
**[![Download](../../ssms/media/download-icon.png) Download Microsoft JDBC Driver 10.2 for SQL Server (tar.gz)](https://go.microsoft.com/fwlink/?linkid=2186164)**
2424

2525
### Version information
2626

27-
- Release number: 9.4.1
28-
- Released: December 7, 2021
27+
- Release number: 10.2.0
28+
- Released: January 31, 2022
2929

3030
When you download the driver, there are multiple JAR files. The name of the JAR file indicates the version of Java that it supports.
3131

@@ -36,11 +36,11 @@ When you download the driver, there are multiple JAR files. The name of the JAR
3636

3737
This release of Microsoft JDBC Driver for SQL Server is available in the following languages:
3838

39-
Microsoft JDBC Driver 9.4.1 for SQL Server (zip):
40-
[Chinese (Simplified)](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x804) | [Chinese (Traditional)](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x404) | [English (United States)](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x409) | [French](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x40c) | [German](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x407) | [Italian](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x410) | [Japanese](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x411) | [Korean](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x412) | [Portuguese (Brazil)](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x416) | [Russian](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x419) | [Spanish](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x40a)
39+
Microsoft JDBC Driver 10.2.0 for SQL Server (zip):
40+
[Chinese (Simplified)](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x804) | [Chinese (Traditional)](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x404) | [English (United States)](https://go.microsoft.com/fwlink/?linkid=2183120&clcid=0x409) | [French](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x40c) | [German](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x407) | [Italian](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x410) | [Japanese](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x411) | [Korean](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x412) | [Portuguese (Brazil)](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x416) | [Russian](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x419) | [Spanish](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x40a)
4141

42-
Microsoft JDBC Driver 9.4.1 for SQL Server (tar.gz):
43-
[Chinese (Simplified)](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x804) | [Chinese (Traditional)](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x404) | [English (United States)](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x409) | [French](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x40c) | [German](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x407) | [Italian](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x410) | [Japanese](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x411) | [Korean](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x412) | [Portuguese (Brazil)](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x416) | [Russian](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x419) | [Spanish](https://go.microsoft.com/fwlink/?linkid=2183223&clcid=0x40a)
42+
Microsoft JDBC Driver 10.2.0 for SQL Server (tar.gz):
43+
[Chinese (Simplified)](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x804) | [Chinese (Traditional)](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x404) | [English (United States)](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x409) | [French](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x40c) | [German](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x407) | [Italian](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x410) | [Japanese](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x411) | [Korean](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x412) | [Portuguese (Brazil)](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x416) | [Russian](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x419) | [Spanish](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x40a)
4444

4545
### Release notes
4646

@@ -58,7 +58,7 @@ The JDBC driver can be added to a Maven project by adding it as a dependency in
5858
<dependency>
5959
<groupId>com.microsoft.sqlserver</groupId>
6060
<artifactId>mssql-jdbc</artifactId>
61-
<version>9.4.1.jre11</version>
61+
<version>10.2.0.jre11</version>
6262
</dependency>
6363
```
6464

docs/connect/jdbc/release-notes-for-the-jdbc-driver.md

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Release notes
33
description: This article lists the releases of the Microsoft JDBC Driver for SQL Server. For each release version, the changes are named and described.
44
ms.custom: ""
5-
ms.date: 12/07/2021
5+
ms.date: 01/31/2022
66
ms.prod: sql
77
ms.prod_service: connectivity
88
ms.reviewer: ""
@@ -16,6 +16,60 @@ ms.author: v-davidengel
1616

1717
This article lists the releases of the _Microsoft JDBC Driver for SQL Server_. For each release version, the changes are named and described.
1818

19+
## <a id="94"></a> 10.2
20+
21+
**[![Download](../../ssms/media/download-icon.png) Download Microsoft JDBC Driver 10.2.0 for SQL Server (zip)](https://go.microsoft.com/fwlink/?linkid=2186163)**
22+
**[![Download](../../ssms/media/download-icon.png) Download Microsoft JDBC Driver 10.2.0 for SQL Server (tar.gz)](https://go.microsoft.com/fwlink/?linkid=2186164)**
23+
24+
Release number: 10.2.0
25+
Released: January 31, 2022
26+
27+
If you need to download the driver in a language other than the one detected for you, you can use these direct links.
28+
For the driver in a zip file: [Chinese (Simplified)](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x804) | [Chinese (Traditional)](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x404) | [English (United States)](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x409) | [French](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x40c) | [German](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x407) | [Italian](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x410) | [Japanese](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x411) | [Korean](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x412) | [Portuguese (Brazil)](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x416) | [Russian](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x419) | [Spanish](https://go.microsoft.com/fwlink/?linkid=2186163&clcid=0x40a)
29+
For the driver in a tar.gz file: [Chinese (Simplified)](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x804) | [Chinese (Traditional)](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x404) | [English (United States)](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x409) | [French](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x40c) | [German](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x407) | [Italian](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x410) | [Japanese](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x411) | [Korean](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x412) | [Portuguese (Brazil)](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x416) | [Russian](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x419) | [Spanish](https://go.microsoft.com/fwlink/?linkid=2186164&clcid=0x40a)
30+
31+
### 10.2 Compliance
32+
33+
| Compliance change | Details |
34+
| :---------------- | :------ |
35+
| Download the latest updates for JDBC Driver 10.2. | &bull; &nbsp; [GitHub, 10.2.0](https://github.com/Microsoft/mssql-jdbc/releases/tag/v10.2.0)<br/>&bull; &nbsp; [Maven Central](https://search.maven.org/search?q=g:com.microsoft.sqlserver) |
36+
| Fully compliant with JDBC API Specification 4.2. | The jars in the 10.2 package are named according to Java version compatibility.<br/><br/>For example, the mssql-jdbc-10.20.jre17.jar file from the 10.2 package should be used with Java 17. |
37+
| Compatible with Java Development Kit (JDK) version 17.0, 11.0, and 1.8. | Microsoft JDBC Driver 10.2 for SQL Server is now compatible with Java Development Kit (JDK) version 17.0 in addition to JDK 11.0 and 1.8. |
38+
| &nbsp; | &nbsp; |
39+
40+
### New features in 10.2
41+
42+
| Feature | Details |
43+
| :---------- | :----------- |
44+
| Java 17 support | The driver is now compatible with Java Development Kit (JDK) version 17.0 in addition to JDK 11.0 and 1.8. |
45+
| Idle Connection Resiliency support | Idle Connection Resiliency is now supported. See [Idle Connection Resiliency](connection-resiliency.md). |
46+
| Multi-user Key Store Providers | The driver now supports Key Store providers at the connection and statement level to support multi-user scenarios. See [Using Always Encrypted with the JDBC driver](using-always-encrypted-with-the-jdbc-driver.md). |
47+
| &nbsp; | &nbsp; |
48+
49+
### Changes in 10.2
50+
51+
| Change | Details |
52+
| :---------- | :----------- |
53+
| Default encrypt to true | **BREAKING CHANGE** TLS encryption is enabled by default. |
54+
| Certificate validation when encrypt = false | **BREAKING CHANGE** When encrypt = false but the server requires encryption, the certificate will be validated based on the trustServerCertificate connection setting.
55+
| aadSecurePrincipalId and aadSecurePrincipalSecret deprecated | The aadSecurePrincipalId and aadSecurePrincipalSecret connection properties have been deprecated. Use username and password instead. |
56+
| getAADSecretPrincipalId API removed | **BREAKING CHANGE** The getAADSecretPrincipalId API has been removed for security reasons. |
57+
| SQL_Variant support | Added support for SQL_Variant datatype when retrieving DateTimeOffset. |
58+
| Non-blocking random in Linux | Updated to use a non-blocking random call when generating a GUID for enclave packages. |
59+
| CNAME resolution for realm | Added CNAME resolution when realm is specified. |
60+
| Updated dependencies | Updated dependency versions for `azure-identity`, `azure-security-keyvault-keys`, `gson`, and `bouncycastle`. |
61+
| &nbsp; | &nbsp; |
62+
63+
### Fixes in 10.2
64+
65+
| Fix | Details |
66+
| :---------- | :----------- |
67+
| TDSParser stuck on TDS_COLMETADATA | Fixed: TDSParser stuck on TDS_COLMETADATA, which could result in a hang for certain queries. [GitHub Issue #1661](https://github.com/microsoft/mssql-jdbc/issues/1661) |
68+
| &nbsp; | &nbsp; |
69+
70+
71+
## Previous releases
72+
1973
## <a id="94"></a> 9.4
2074

2175
**[![Download](../../ssms/media/download-icon.png) Download Microsoft JDBC Driver 9.4.1 for SQL Server (zip)](https://go.microsoft.com/fwlink/?linkid=2183120)**
@@ -90,8 +144,6 @@ For the driver in a tar.gz file: [Chinese (Simplified)](https://go.microsoft.com
90144
| [GitHub Issue #1531](https://github.com/microsoft/mssql-jdbc/issues/1531) | Fixed potential integer overflow in TDSWriter.writeString() |
91145
| &nbsp; | &nbsp; |
92146

93-
## Previous releases
94-
95147
## <a id="92"></a> 9.2
96148

97149
**[![Download](../../ssms/media/download-icon.png) Download Microsoft JDBC Driver 9.2.1 for SQL Server (zip)](https://go.microsoft.com/fwlink/?linkid=2155948)**

docs/connect/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2907,6 +2907,8 @@
29072907
href: ../connect/jdbc/using-statements-with-stored-procedures.md
29082908
- name: Client Certificate Authentication for Loopback Scenarios
29092909
href: ../connect/jdbc/client-certification-authentication-for-loopback-scenarios.md
2910+
- name: Connection resiliency
2911+
href: ../connect/jdbc/connection-resiliency.md
29102912
- name: Azure Key Vault samples, for 7.0 and others
29112913
href: ../connect/jdbc/azure-key-vault-sample-version-7.0.md
29122914
items:
Binary file not shown.
6.25 KB
Loading

docs/relational-databases/import-export/use-a-format-file-to-skip-a-table-column-sql-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The previous command creates a non-XML format file, `myTestSkipCol_Default.fmt`.
7474

7575
The following screenshot shows the values in this sample default format files.
7676

77-
![default non-XML format file for myTestSkipCol](../../relational-databases/import-export/media/mytestskipcol-f-c-default-fmt.gif "default non-XML format file for myTestSkipCol")
77+
![default non-XML format file for myTestSkipCol](../../relational-databases/import-export/media/mytestskipcol-f-c-default-fmt.png "default non-XML format file for myTestSkipCol")
7878

7979
> [!NOTE]
8080
> For more information about the format-file fields, see [Non-XML Format Files &#40;SQL Server&#41;](../../relational-databases/import-export/non-xml-format-files-sql-server.md).

0 commit comments

Comments
 (0)