Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions docs/src/main/sphinx/connector/sqlserver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appropriate for your setup:
.. code-block:: properties

connector.name=sqlserver
connection-url=jdbc:sqlserver://<host>:<port>;database=<database>
connection-url=jdbc:sqlserver://<host>:<port>;database=<database>;encrypt=false
Comment thread
mosabua marked this conversation as resolved.
Outdated
connection-user=root
connection-password=secret

Expand All @@ -49,20 +49,21 @@ properties files.
Connection security
^^^^^^^^^^^^^^^^^^^

If you have TLS configured with a globally-trusted certificate installed on your
data source, you can enable TLS between your cluster and the data
source by appending a parameter to the JDBC connection string set in the
``connection-url`` catalog configuration property.
The JDBC driver, and therefore the connector, automatically use Transport Layer
Security (TLS) encryption and certificate validation. This requires a suitable
TLS certificate configured on your SQL Server database host.

For example, with the JDBC driver for SQL Server 2019, enable TLS by appending
the ``encrypt=true`` parameter to the ``connection-url`` configuration property:
If you do not have the necessary configuration established, you can disable
encryption in the connection string with the ``encrypt`` property:

.. code-block:: properties

connection-url=jdbc:sqlserver://<host>:<port>;database=<database>;encrypt=true
connection-url=jdbc:sqlserver://<host>:<port>;database=<database>;encrypt=false

For more information on TLS configuration options, see the `SQL Server JDBC
driver documentation <https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url>`_.
Further parameters like ``trustServerCertificate``, ``hostNameInCertificate``,
``trustStore``, and ``trustStorePassword`` are details in the `TLS section of
SQL Server JDBC driver documentation
<https://docs.microsoft.com/en-us/sql/connect/jdbc/using-ssl-encryption>`_.

Multiple SQL Server databases or servers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ public String getUsername()
// enable case sensitive (see the CS below) collation for SQL identifiers
container.addEnv("MSSQL_COLLATION", "Latin1_General_CS_AS");

// TLS and certificate validation are on by default, and need
// to be disabled for tests.
container.withUrlParam("encrypt", "false");

Closeable cleanup = startOrReuse(container);
try {
setUpDatabase(sqlExecutorForContainer(container), databaseName, databaseSetUp);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>9.4.1.jre11</version>
<version>10.2.0.jre11</version>
Comment thread
ebyhr marked this conversation as resolved.
Outdated
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
connector.name=sqlserver
connection-url=jdbc:sqlserver://sqlserver
connection-url=jdbc:sqlserver://sqlserver;encrypt=false
connection-user=sa
connection-password=SQLServerPass1
allow-drop-table=true
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ databases:

sqlserver:
jdbc_driver_class: com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc_url: jdbc:sqlserver://sqlserver
jdbc_url: jdbc:sqlserver://sqlserver;encrypt=false
jdbc_user: sa
jdbc_password: SQLServerPass1
jdbc_pooling: true
Expand Down
2 changes: 1 addition & 1 deletion testing/trino-server-dev/etc/catalog/sqlserver.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
connector.name=sqlserver
connection-url=jdbc:sqlserver://sqlserver
connection-url=jdbc:sqlserver://sqlserver;encrypt=false
connection-user=sa
connection-password=SQLServerPass1