-3

I'm getting this 2 errors repeatedly when I'm trying to connect eclipse with sql server through jdbc.Can anyone help me with this or explain why am GETTING THIS??

1.The TCP/IP connection to the host localhost, port 1433 has failed .2.The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption.

Thank you..

this is the code am working on.

String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
Class.forName(driver).newInstance();
String connString ="jdbc:sqlserver://localhost:1433/databaseName=Engg_Street;instance=SQLSERVER;encrypt=true;     trustServerCertificate=true";
String username = "Vijayalakshmi";
String password = "";
conn = DriverManager.getConnection(connString,username,password);
zero323
  • 322,348
  • 103
  • 959
  • 935
Navin Kumar
  • 452
  • 1
  • 6
  • 10

1 Answers1

0

Take the encrypt=true;trustServerCertificate=true out of your connection string. Your SQL Server probably isn't set up to use SSL for its connections.

dpw
  • 1,576
  • 9
  • 14