SQL server JDBC connection URLs
Format
jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]
Fields:
Field |
Description |
---|---|
serverName |
The address of the server to connect to |
instanceName |
The instance to connect to on serverName If not specified, a connection to the default instance is made |
portNumber |
The port to connect to on serverName (The default is 1433.) |
Table 474: SQL server JDBC connection URL fields |
Additional properties:
Property |
Default |
Description |
---|---|---|
databaseName |
null |
The name of the database to connect to If not stated, a connection is made to the default database |
password |
null |
The database password |
trustServerCertificate=true |
null |
This parameter must be set to “true” starting with Microsoft JDBC driver 10.2 and up. (Since JDBC driver version 10.2, SQL Server uses TLS encryption by default based on property “encrypt”.) |
userName |
null |
The database user |
Table 475: SQL server JDBC connection URL properties |
For related information see:
-
SQL Server – “Setting the connection properties” [SQL Server Connection]
-
SQL Server – “Understanding encryption support” [SQL Server Encryption]
-
SQL Server – “Building the connection URL” [SQL Server URL]