**
This is the connection path **
**
private String url ="jdbc:sqlserver://SAUL:1433;databaseName=prueba";
private String login = "dev";
private String password = "123456";
private String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
Connection conn = null;
public BDConnection() {
}
public Connection EstablecerConexion() {
try {
Class.forName(driver);
conn = DriverManager.getConnection(url,
login, password);
} catch (ClassNotFoundException | SQLException ex) {
ex.printStackTrace();
}
return conn;
}
This is the problem that is displayed when running the program
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server with Secure Sockets Layer encryption (SSL). Error: "The server selected protocol version TLS10 is not accepted by client preferences [TLS12]" . ClientConnectionId:ba132bbf-7f8c-47c6-9892-b7901f8e8b75 at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2400) at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1762) com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1459) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:773) at javaapplication2.JavaApplication2.main(JavaApplication2.java:19) Caused by: javax.net.ssl.SSLHandshakeException: The server selected protocol version TLS10 is not accepted by client preferences [TLS12]
您必须更新您的 SQL 服务器实例并启用 TLS 1.2,请点击此链接
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.