我正在尝试从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,并重新启动了实例。但仍然显示“服务器不可用”。
还有其他的想法吗?