-3
當我試圖通過jdbc連接eclipse與sql服務器時,我得到了這2個錯誤。任何人都可以幫助我解決這個問題或解釋爲什麼GETTING這個??主機localhost,端口1433的TCP/IP連接失敗
1.與主機localhost,端口1433的TCP/IP連接失敗.2。驅動程序無法使用安全套接字層(SSL)加密與SQL Server建立安全連接。
謝謝..
這是我工作的代碼。
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);
參考以下鏈接 http://stackoverflow.com/questions/11820799/com-microsoft-sqlserver-jdbc-sqlserverexception-the-tcp-ip-connection-to-the-ho – sunysen
是SQL由於SQL Server 2005,TCP/IP在端口1433,IIRC上運行,默認情況下禁用TCP/IP,如果啓用,它默認使用隨機端口。 –
不要多次發佈相同的問題,而應該編輯現有的帖子,如果您認爲需要澄清的話! –