java l连接sql server 2008

The TCP/IP connection to the host localhost, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.
1.确认数据库服务启动了。
2.确认是否有库存在。(是不是只安了sqlserver而没有建库。)
3.如果在数据库本机上使用没有问题。那么确认一下是不是防火墙阻挡了端口。

在使用过程中 如果防火墙关闭了 电脑没用重启,则可能运行报错.所以都确定正常后,电脑重启一下应该可以了。

猜你喜欢

转载自y112300.iteye.com/blog/1997845