我正嘗試使用jdbc驅動程序連接MS SQL服務器。我越來越低於錯誤;如何使用jdbc設置實例名稱
Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall
我認爲我的連接URL存在問題。這是我的連接網址;
jdbc:sqlserver://50.50.50.50\MYINSTANCE:1433;
編輯:我可以連接這個SQL服務器與一些客戶端應用程序(HeidiSQL)沒有任何問題。
Network type: Microsoft SQL server (tcp/ip)
Hostname:50.50.50.50\MYINSTANCE
Port: 1433
username:...
password:...
以下行拋出異常,我可以連接一些其他的SQL服務器沒有任何問題。(他們沒有任何實例名)
DriverManager.getConnection(connectionUrl, username, password);
一般形式爲:'爲jdbc:SQLSERVER:// [服務器[\實例] [:端口號] [;屬性=值[;屬性=值]]'。看起來很完美。 –
您是否已經完成了該消息告訴您要做的所有檢查? –
對於HeidiSQL而言,您沒有提供端口嗎?請檢查以確保您的SQL Server正在接受1433上的連接。 –