You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Connection resiliency can transparently restore broken idle connections. This feature improves application behavior when the server closes idle connections.
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)
Copy file name to clipboardExpand all lines: docs/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Download
3
3
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
5
5
ms.prod: sql
6
6
ms.prod_service: connectivity
7
7
ms.reviewer: ""
@@ -17,15 +17,15 @@ The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides d
17
17
18
18
## Download
19
19
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.
21
21
22
-
**[ Download Microsoft JDBC Driver 9.4 for SQL Server (zip)](https://go.microsoft.com/fwlink/?linkid=2183120)**
23
-
**[ Download Microsoft JDBC Driver 9.4 for SQL Server (tar.gz)](https://go.microsoft.com/fwlink/?linkid=2183223)**
22
+
**[ Download Microsoft JDBC Driver 10.2 for SQL Server (zip)](https://go.microsoft.com/fwlink/?linkid=2186163)**
23
+
**[ Download Microsoft JDBC Driver 10.2 for SQL Server (tar.gz)](https://go.microsoft.com/fwlink/?linkid=2186164)**
24
24
25
25
### Version information
26
26
27
-
- Release number: 9.4.1
28
-
- Released: December 7, 2021
27
+
- Release number: 10.2.0
28
+
- Released: January 31, 2022
29
29
30
30
When you download the driver, there are multiple JAR files. The name of the JAR file indicates the version of Java that it supports.
31
31
@@ -36,11 +36,11 @@ When you download the driver, there are multiple JAR files. The name of the JAR
36
36
37
37
This release of Microsoft JDBC Driver for SQL Server is available in the following languages:
Copy file name to clipboardExpand all lines: docs/connect/jdbc/release-notes-for-the-jdbc-driver.md
+55-3Lines changed: 55 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Release notes
3
3
description: This article lists the releases of the Microsoft JDBC Driver for SQL Server. For each release version, the changes are named and described.
4
4
ms.custom: ""
5
-
ms.date: 12/07/2021
5
+
ms.date: 01/31/2022
6
6
ms.prod: sql
7
7
ms.prod_service: connectivity
8
8
ms.reviewer: ""
@@ -16,6 +16,60 @@ ms.author: v-davidengel
16
16
17
17
This article lists the releases of the _Microsoft JDBC Driver for SQL Server_. For each release version, the changes are named and described.
18
18
19
+
## <aid="94"></a> 10.2
20
+
21
+
**[ Download Microsoft JDBC Driver 10.2.0 for SQL Server (zip)](https://go.microsoft.com/fwlink/?linkid=2186163)**
22
+
**[ 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. |• [GitHub, 10.2.0](https://github.com/Microsoft/mssql-jdbc/releases/tag/v10.2.0)<br/>• [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
+
| | |
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
+
| | |
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
+
| | |
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
+
| | |
69
+
70
+
71
+
## Previous releases
72
+
19
73
## <aid="94"></a> 9.4
20
74
21
75
**[ 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
90
144
|[GitHub Issue #1531](https://github.com/microsoft/mssql-jdbc/issues/1531)| Fixed potential integer overflow in TDSWriter.writeString() |
91
145
| | |
92
146
93
-
## Previous releases
94
-
95
147
## <aid="92"></a> 9.2
96
148
97
149
**[ Download Microsoft JDBC Driver 9.2.1 for SQL Server (zip)](https://go.microsoft.com/fwlink/?linkid=2155948)**
Copy file name to clipboardExpand all lines: docs/relational-databases/import-export/use-a-format-file-to-skip-a-table-column-sql-server.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ The previous command creates a non-XML format file, `myTestSkipCol_Default.fmt`.
74
74
75
75
The following screenshot shows the values in this sample default format files.
76
76
77
-

77
+

78
78
79
79
> [!NOTE]
80
80
> For more information about the format-file fields, see [Non-XML Format Files (SQL Server)](../../relational-databases/import-export/non-xml-format-files-sql-server.md).
0 commit comments