我想通过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