我想通過JDBC驅動程序連接到SQL Server,但不斷收到此錯誤:連接到SQL Server使用JDBC錯誤
Error connecting to the specified data source: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. 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.".
我的連接字符串是:
jdbc:sqlserver://localhost\SRVR_SQL:1433;DatabaseName=spotfire_server
我也試過這樣:
jdbc:sqlserver://10.10.60.12\SRVR_SQL:1433;DatabaseName=spotfire_server
這:
jdbc:sqlserver://localhost:1433;DatabaseName=spotfire_server
這:
jdbc:sqlserver://SRVR_SQL:1433;DatabaseName=spotfire_server
但他們都給出了同樣的錯誤
可能重複失敗,錯誤:TCP/IP連接到主機失敗](http://stackoverflow.com/questions/18841744/jdbc-connection-failed-error-tcp-ip-connection-to-host-failed) – duffymo