Skip to content

Commit 2841631

Browse files
Merge pull request #36733 from MicrosoftDocs/main
Auto Publish – main to live - 2026-02-27 18:30 UTC
2 parents 15125f4 + 96a7447 commit 2841631

12 files changed

Lines changed: 820 additions & 320 deletions

docs/connect/jdbc/building-the-connection-url.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn about formatting the connection string used by the Microsoft
44
author: David-Engel
55
ms.author: davidengel
66
ms.reviewer: vanto
7-
ms.date: 09/12/2024
7+
ms.date: 02/26/2026
88
ms.service: sql
99
ms.subservice: connectivity
1010
ms.topic: how-to
@@ -23,12 +23,12 @@ Where:
2323

2424
- **serverName** (Optional) - Is the address of the server to connect to. This address can be a DNS or IP address, or it can be `localhost` or `127.0.0.1` for the local computer. If not specified in the connection URL, the server name must be specified in the properties collection.
2525

26-
- **instanceName** (Optional) - Is the instance to connect to on `serverName`. If not specified, a connection to the default instance is made.
26+
- **instanceName** (Optional) - Is the instance to connect to on `serverName`. If not specified, the driver connects to the default instance.
2727

2828
- **portNumber** (Optional) - Is the port to connect to on `serverName`. The default is `1433`. If you're using the default port, you don't have to specify the port, nor the preceding `:` in the URL.
2929

3030
> [!NOTE]
31-
> For optimal connection performance, you should set the `portNumber` when you connect to a named instance. This will avoid a round trip to the server to determine the port number. If both a `portNumber` and `instanceName` are used, the `portNumber` will take precedence and the `instanceName` will be ignored.
31+
> For optimal connection performance, set the `portNumber` when you connect to a named instance. This avoids a round trip to the server to determine the port number. If you use both a `portNumber` and `instanceName`, the `portNumber` takes precedence and the `instanceName` is ignored.
3232
3333
- **property** (Optional) - Is one or more option connection properties. For more information, see [Setting the connection properties](setting-the-connection-properties.md). Any property from the list can be specified. Properties can only be delimited by using the semicolon (`;`), and they can't be duplicated.
3434

@@ -72,7 +72,7 @@ jdbc:sqlserver://;servername=server_name;encrypt=true;integratedSecurity=true;au
7272

7373
## Named and multiple SQL Server instances
7474

75-
[!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] allows for the installation of multiple database instances per server. Each instance is identifiable by a specific name. To connect to a named instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], you can either specify the port number of the named instance (preferred). You can also specify the instance name as a JDBC URL property or a **datasource** property. If no instance name or port number property is specified, a connection to the default instance is created. See the following examples:
75+
[!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] allows for the installation of multiple database instances per server. Each instance has a specific name. To connect to a named instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], you can either specify the port number of the named instance (preferred). You can also specify the instance name as a JDBC URL property or a **datasource** property. If you don't specify an instance name or port number property, the driver creates a connection to the default instance. See the following examples:
7676

7777
- To specify a port number, use the following format:
7878

@@ -97,7 +97,10 @@ In version 8.4 and above, escaped values can contain special characters, includi
9797
9898
## <a name="Connectingintegrated"></a> Connecting with integrated authentication On Windows
9999

100-
The JDBC driver supports the use of Type 2 integrated authentication on Windows operating systems by using the `integratedSecurity` connection string property. To use integrated authentication, copy the `mssql-jdbc_auth-<version>-<arch>.dll` file to a directory on the Windows system path on the computer where the JDBC driver is installed.
100+
The JDBC driver supports the use of Type 2 integrated authentication on Windows operating systems by using the `integratedSecurity` connection string property. To use integrated authentication, copy the `mssql-jdbc_auth-<version>-<arch>.dll` file to any directory that is included in the Windows system `PATH` environment variable.
101+
102+
> [!NOTE]
103+
> The DLL doesn't need to be in the same directory as the JDBC driver JAR file. It only needs to be in a directory listed in the system `PATH`, for example `C:\Windows\System32` or a custom directory that you add to `PATH`.
101104
102105
The `mssql-jdbc_auth-<version>-<arch>.dll` files are installed in the following location:
103106

@@ -106,9 +109,9 @@ The `mssql-jdbc_auth-<version>-<arch>.dll` files are installed in the following
106109
For any operating system supported by the [!INCLUDE [jdbcNoVersion](../../includes/jdbcnoversion_md.md)], see [Using Kerberos integrated authentication to connect to SQL Server](using-kerberos-integrated-authentication-to-connect-to-sql-server.md) for a description of a feature added in [!INCLUDE [jdbc-40](../../includes/jdbc-40-md.md)] that allows an application to connect to a database using integrated authentication with Type 4 Kerberos.
107110

108111
> [!NOTE]
109-
> If you are running a 32-bit Java Virtual Machine (JVM), use the `mssql-jdbc_auth-<version>-<arch>.dll` file in the x86 folder, even if the operating system is the x64 version. If you are running a 64-bit JVM on a x64 processor, use the `mssql-jdbc_auth-<version>-<arch>.dll` file in the x64 folder.
112+
> If you're running a 32-bit Java Virtual Machine (JVM), use the `mssql-jdbc_auth-<version>-<arch>.dll` file in the x86 folder, even if the operating system is the x64 version. If you're running a 64-bit JVM on a x64 processor, use the `mssql-jdbc_auth-<version>-<arch>.dll` file in the x64 folder.
110113
111-
Alternatively you can set the java.library.path system property to specify the directory of the `mssql-jdbc_auth-<version>-<arch>.dll`. For example, if the JDBC driver is installed in the default directory, you can specify the location of the DLL by using the following virtual machine (VM) argument when the Java application is started:
114+
Alternatively, you can set the java.library.path system property to specify the directory of the `mssql-jdbc_auth-<version>-<arch>.dll`. For example, if you installed the JDBC driver in the default directory, you can specify the location of the DLL by using the following virtual machine (VM) argument when the Java application starts:
112115

113116
`-Djava.library.path=C:\Microsoft JDBC Driver 6.4 for SQL Server\sqljdbc_<version>\enu\auth\x86`
114117

docs/connect/jdbc/using-the-jdbc-driver.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Using the JDBC driver
33
description: This section provides quick start instructions to make a simple connection to a SQL Server database using the Microsoft JDBC Driver for SQL Server.
44
author: David-Engel
55
ms.author: davidengel
6-
ms.date: 03/17/2025
6+
ms.date: 02/26/2026
77
ms.service: sql
88
ms.subservice: connectivity
99
ms.topic: quickstart
@@ -462,7 +462,7 @@ The following snippet is an example of the CLASSPATH statement that's used for a
462462
Make sure that the CLASSPATH statement contains only one [!INCLUDE[jdbcNoVersion](../../includes/jdbcnoversion_md.md)], such as either sqljdbc.jar, sqljdbc4.jar, sqljdbc41.jar, or sqljdbc42.jar.
463463

464464
> [!NOTE]
465-
> On Windows systems, directory names longer than the 8.3 filename convention or folder names with spaces may cause problems with classpaths. If you suspect these types of issues, you should temporarily move the sqljdbc.jar file, sqljdbc4.jar file, or the sqljdbc41.jar file into a simple directory name such as `C:\Temp`, change the classpath, and determine whether that addresses the problem.
465+
> On Windows systems, directory names longer than the 8.3 filename convention or folder names with spaces may cause problems with classpaths. If you suspect these types of problems, temporarily move the sqljdbc.jar file, sqljdbc4.jar file, or the sqljdbc41.jar file into a simple directory name such as `C:\Temp`, change the classpath, and determine whether that addresses the problem.
466466
467467
### Applications that are run directly at the command prompt
468468

@@ -494,17 +494,23 @@ Connection con = DriverManager.getConnection(connectionUrl);
494494
```
495495

496496
> [!WARNING]
497-
> The above connection string uses `encrypt=false`, which is not recommended for production use. For more information about encrypting your database connection with JDBC, see [Connecting with encryption](connecting-with-ssl-encryption.md).
497+
> The above connection string uses `encrypt=false`, which isn't recommended for production use. For more information about encrypting your database connection with JDBC, see [Connecting with encryption](connecting-with-ssl-encryption.md).
498498
499499
Starting from JDBC API 4.0, the `DriverManager.getConnection()` method is enhanced to load JDBC drivers automatically. Therefore, applications don't need to call the `Class.forName` method to register or load the driver when using driver jar libraries.
500500

501-
When the getConnection method of the DriverManager class is called, an appropriate driver is located from the set of registered JDBC drivers. sqljdbc4.jar, sqljdbc41.jar, or sqljdbc42.jar file includes "META-INF/services/java.sql.Driver" file, which contains the **com.microsoft.sqlserver.jdbc.SQLServerDriver** as a registered driver. The existing applications, which currently load the drivers by using the Class.forName method, will continue to work without modification.
501+
When you call the getConnection method of the DriverManager class, it locates an appropriate driver from the set of registered JDBC drivers. sqljdbc4.jar, sqljdbc41.jar, or sqljdbc42.jar file includes "META-INF/services/java.sql.Driver" file, which contains the **com.microsoft.sqlserver.jdbc.SQLServerDriver** as a registered driver. The existing applications, which currently load the drivers by using the Class.forName method, continue to work without modification.
502502

503503
> [!NOTE]
504-
> sqljdbc4.jar, sqljdbc41.jar, or sqljdbc42.jar class library cannot be used with older versions of the Java Runtime Environment (JRE). See [System requirements for the JDBC driver](../../connect/jdbc/system-requirements-for-the-jdbc-driver.md) for the list of JRE versions supported by the [!INCLUDE[jdbcNoVersion](../../includes/jdbcnoversion_md.md)].
504+
> sqljdbc4.jar, sqljdbc41.jar, or sqljdbc42.jar class library can't be used with older versions of the Java Runtime Environment (JRE). See [System requirements for the JDBC driver](../../connect/jdbc/system-requirements-for-the-jdbc-driver.md) for the list of JRE versions supported by the [!INCLUDE[jdbcNoVersion](../../includes/jdbcnoversion_md.md)].
505505
506506
For more information about how to connect with data sources and use a connection URL, see [Building the connection URL](../../connect/jdbc/building-the-connection-url.md) and [Setting the connection properties](../../connect/jdbc/setting-the-connection-properties.md).
507-
508-
## See also
509507

510-
[Overview of the JDBC driver](../../connect/jdbc/overview-of-the-jdbc-driver.md)
508+
> [!TIP]
509+
> The previous example uses `DriverManager` for simplicity. For production applications, consider using the `SQLServerDataSource` class instead, which provides connection pooling and additional configurability. For more information and examples, see [Connecting and retrieving data](connecting-and-retrieving-data.md) and [Data source sample](data-source-sample.md).
510+
511+
## Related content
512+
513+
- [Overview of the JDBC driver](../../connect/jdbc/overview-of-the-jdbc-driver.md)
514+
- [Building the connection URL](../../connect/jdbc/building-the-connection-url.md)
515+
- [Setting the connection properties](../../connect/jdbc/setting-the-connection-properties.md)
516+
- [Connecting and retrieving data](connecting-and-retrieving-data.md)

docs/connect/node-js/step-3-proof-of-concept-connecting-to-sql-using-node-js.md

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Step 3: Connecting to SQL using Node.js"
33
description: "This example should be considered a proof of concept showing how to connect to SQL using Node.js and is simplified for clarity."
44
author: David-Engel
55
ms.author: davidengel
6-
ms.date: "07/23/2019"
6+
ms.date: "02/26/2026"
77
ms.service: sql
88
ms.subservice: connectivity
99
ms.topic: install-set-up-deploy
@@ -12,11 +12,11 @@ ms.topic: install-set-up-deploy
1212

1313
:::image type="icon" source="../../includes/media/download.svg" border="false"::: **[Download Node.js SQL driver](../sql-connection-libraries.md#anchor-20-drivers-relational-access)**
1414

15-
This example should be considered a proof of concept only. The sample code is simplified for clarity, and does not necessarily represent best practices recommended by Microsoft. Other examples, which use the same crucial functions are available in the [GitHub sample repository](https://github.com/tediousjs/tedious/blob/master/examples/).
15+
This example should be considered a proof of concept only. The sample code is simplified for clarity, and doesn't necessarily represent best practices recommended by Microsoft. Other examples, which use the same crucial functions are available in the [GitHub sample repository](https://github.com/tediousjs/tedious/blob/master/examples/).
1616

1717
## Step 1: Connect
1818

19-
The **new Connection** function is used to connect to SQL Database.
19+
Use the **new Connection** function to connect to SQL Database.
2020

2121
```javascript
2222
var Connection = require('tedious').Connection;
@@ -30,7 +30,7 @@ The **new Connection** function is used to connect to SQL Database.
3030
}
3131
},
3232
options: {
33-
// If you are on Microsoft Azure, you need encryption:
33+
// If you're on Microsoft Azure, you need encryption:
3434
encrypt: true,
3535
database: 'your_database' //update me
3636
}
@@ -48,7 +48,7 @@ The **new Connection** function is used to connect to SQL Database.
4848
## Step 2: Execute a query
4949

5050

51-
All SQL statements are executed using the **new Request()** function. If the statement returns rows, such as a select statement, you can retrieve them using the **request.on()** function. If there are no rows, the request.on() function returns empty lists.
51+
Execute all SQL statements using the **new Request** function. If the statement returns rows, such as a select statement, you can retrieve them using the **request.on** function. If there are no rows, the request.on function returns empty lists.
5252

5353

5454
```javascript
@@ -63,7 +63,7 @@ All SQL statements are executed using the **new Request()** function. If the sta
6363
}
6464
},
6565
options: {
66-
// If you are on Microsoft Azure, you need encryption:
66+
// If you're on Microsoft Azure, you need encryption:
6767
encrypt: true,
6868
database: 'your_database' //update me
6969
}
@@ -112,7 +112,7 @@ All SQL statements are executed using the **new Request()** function. If the sta
112112

113113
## Step 3: Insert a row
114114

115-
In this example you will see how to execute an [INSERT](../../t-sql/statements/insert-transact-sql.md) statement safely, passing parameters, which protect your application from [SQL injection](../../relational-databases/security/sql-injection.md) values.
115+
In this example, you see how to execute an [INSERT](../../t-sql/statements/insert-transact-sql.md) statement safely, passing parameters, which protect your application from [SQL injection](../../relational-databases/security/sql-injection.md) values.
116116

117117

118118
```javascript
@@ -127,7 +127,7 @@ In this example you will see how to execute an [INSERT](../../t-sql/statements/i
127127
}
128128
},
129129
options: {
130-
// If you are on Microsoft Azure, you need encryption:
130+
// If you're on Microsoft Azure, you need encryption:
131131
encrypt: true,
132132
database: 'your_database' //update me
133133
}
@@ -170,3 +170,46 @@ In this example you will see how to execute an [INSERT](../../t-sql/statements/i
170170
connection.execSql(request);
171171
}
172172
```
173+
174+
## Step 4: Connect with Windows authentication
175+
176+
The tedious driver supports Windows authentication using NTLM. To connect with domain credentials instead of SQL Server authentication, change the `authentication` section in the connection configuration:
177+
178+
```javascript
179+
var Connection = require('tedious').Connection;
180+
var config = {
181+
server: '<server>', //update me
182+
authentication: {
183+
type: 'ntlm',
184+
options: {
185+
domain: '<domain>', //update me
186+
userName: '<username>', //update me
187+
password: '<password>' //update me
188+
}
189+
},
190+
options: {
191+
encrypt: false,
192+
database: '<database>', //update me
193+
port: 1433
194+
}
195+
};
196+
var connection = new Connection(config);
197+
connection.on('connect', function(err) {
198+
if (err) {
199+
console.log('Connection failed', err);
200+
} else {
201+
console.log('Connected with Windows authentication');
202+
}
203+
});
204+
205+
connection.connect();
206+
```
207+
208+
> [!NOTE]
209+
> NTLM authentication requires you to provide domain credentials in the configuration. For trusted connections that use the currently logged-in Windows user without specifying credentials, consider the [msnodesqlv8](https://www.npmjs.com/package/msnodesqlv8) package, which uses the native ODBC driver.
210+
211+
## Related content
212+
213+
- [Node.js driver for SQL Server](node-js-driver-for-sql-server.md)
214+
- [Step 1: Configure development environment for Node.js development](step-1-configure-development-environment-for-node-js-development.md)
215+
- [Step 2: Create a SQL database for Node.js development](step-2-create-a-sql-database-for-node-js-development.md)

docs/connect/php/download-drivers-php-sql-server.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Download the Microsoft Drivers for PHP for SQL Server
33
description: Download the Microsoft Drivers for PHP for SQL Server to develop PHP applications that connect to SQL Server and Azure SQL Database.
44
author: David-Engel
55
ms.author: davidengel
6-
ms.date: 01/31/2024
6+
ms.date: 02/24/2026
77
ms.service: sql
88
ms.subservice: connectivity
99
ms.topic: install-set-up-deploy
@@ -16,18 +16,18 @@ On Linux and macOS, the drivers for PHP are easily downloaded and installed usin
1616

1717
## Download
1818

19-
Microsoft Drivers 5.12 for PHP for SQL Server is the latest general availability (GA) version.
19+
Microsoft Drivers 5.13 for PHP for SQL Server is the latest general availability (GA) version.
2020

21-
:::image type="icon" source="../../includes/media/download.svg" border="false"::: **[Download Microsoft Drivers for PHP for SQL Server (Windows)](https://go.microsoft.com/fwlink/?linkid=2258816)**
22-
[GitHub Release Tag v5.12.0 (Linux and macOS packages are available here)](https://github.com/Microsoft/msphpsql/releases/v5.12.0)
21+
:::image type="icon" source="../../includes/media/download.svg" border="false"::: **[Download Microsoft Drivers for PHP for SQL Server (Windows)](https://go.microsoft.com/fwlink/?linkid=2353424)**
22+
[GitHub Release Tag v5.13.0 (Linux and macOS packages are available here)](https://github.com/Microsoft/msphpsql/releases/v5.13.0)
2323

2424
> [!NOTE]
2525
> Make sure you have the latest version of the ODBC driver installed to ensure optimal performance and security. For download information, see [Download ODBC Driver for SQL Server](../odbc/download-odbc-driver-for-sql-server.md).
2626
2727
### Version information
2828

29-
- Release number: 5.12.0
30-
- Released: January 31, 2023
29+
- Release number: 5.13.0
30+
- Released: February 27, 2026
3131

3232
If you have feedback, the best way to contact the Microsoft Drivers for PHP for SQL Server team is by filing an issue on the [GitHub repository](https://github.com/Microsoft/msphpsql/issues).
3333

0 commit comments

Comments
 (0)