我正在尝试从Java程序连接到MS SQL Server(在我的机器上运行).我得到了以下冗长的例外情况:
Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".
当我检查"属性"并在MS SQL的对象资源管理器中单击"查看连接属性"时,我发现"服务器不可用".这似乎与异常消息有关.
如何使服务器可用?
编辑:
我正在使用SQL Server 2008,现在我已经启用了TCP/IP,并重新启动了我的实例.我仍然被告知"服务器不可用".
还有其他想法吗?