SQL Server JDBC Error on Java 8: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

前端 未结 8 2262
鱼传尺愫
鱼传尺愫 2020-11-27 16:39

I am getting the following error when connecting to a SQL Server database using version the Microsoft JDBC Driver:

com.microsoft.sqlserver.jdbc.SQLSer

8条回答
  •  孤独总比滥情好
    2020-11-27 17:14

    Your url should be like below and add sql sqljdbc42.jar. This will resolve your issue

    url = "jdbc:sqlserver://" +serverName + ":1433;DatabaseName=" + dbName + ";encrypt=true;trustServerCertificate=true;
    

提交回复
热议问题