切换导航
{{systemName}}
{{ info.Title }}
{{info.Title}}
{{ menu.Title }}
{{menu.Title}}
登录
|
退出
搜索
MS SQL Server(Native)在JAVA中使用的问题
作者:ych
#### 驱动程序无法使用安全套接层 (SSL) 加密建立与 SQL Server 的安全连接 使用JDBC 10.2 及以后的版本,当运行travelerUtil命令连接到SQL server时,将遇到如下错误: ``` Using JDBC jar: C:\Domino\Traveler\lib\mssql-jdbc-10.2.0.jre8.jar Checking database connection to: jdbc:sqlserver://
:
;databasename=
Unable to connect to database: Unable to connect to database: 驱动程序无法使用安全套接层 (SSL) 加密建立与 SQL Server 的安全连接。错误: "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:3271aef9-fd8c-4387-8c3d-250ac909ab3b Database configuration was not saved. ``` ##### 原因 这是因为从JDBC 10.2开始,缺省启用了TLS加密,请参考下面的说明了解详细信息: https://docs.microsoft.com/en-us/sql/connect/jdbc/release-notes-for-the-jdbc-driver?view=sql-server-ver15#changes-in-102 ##### 解决方法 解决方法: 对于 Traveler 11.0.x,使用JDBC driver(mssql-jdbc-8.2.2.jre8.jar),参考帮助文档: https://help.hcltechsw.com/traveler/11.0.0/configurelotusnotestravelerfordb2.html 对于Traveler 12.0.x, 使用JDBC driver(mssql-jdbc-9.2.1.jre8.jar),参考帮助文档: https://help.hcltechsw.com/traveler/12.0.0/configurelotusnotestravelerfordb2.html 也可以在使用travelerUtil命令连接到SQL server时,添加参数 ";encrypt=false" 作为workaround, 举例如下: ``` travelerUtil db set url=jdbc:sqlserver://
:
;databasename=
;encrypt=false user=
pw=
``` ##### 关键字段 ``` ;encrypt=true; trustServerCertificate=true; ``` #### MS SQL Server(Native)对应jar包版本下载 [下载地址](https://learn.microsoft.com/zh-cn/sql/connect/jdbc/connecting-with-ssl-encryption?view=sql-server-ver16 "下载地址")
评论区
先去登录
版权所有:机遇屋在线 Copyright © 2021-2025 jiyuwu Co., Ltd.
鲁ICP备16042261号-1