hjjof001
2017-11-15 13:14
采纳率: 60%
浏览 2.3k
已采纳

jdbc连接SQL server连不上

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 127.0.0.1, 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. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1195) at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at javaapplication3.JavaApplication3.JDBCon(JavaApplication3.java:27) at javaapplication3.JavaApplication3.main(JavaApplication3.java:18)图片

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

3条回答 默认 最新

  • JPF1024 2017-11-16 15:24
    最佳回答

    如果是工具可以连接到数据库而Java连接不了,可以参考:

    在服务(运行->services.msc)中,右键相关服务,打开属性,在登录选项卡,选择本地系统账户,之后重启服务.

    评论
    解决 无用
    打赏 举报
查看更多回答(2条)

相关推荐 更多相似问题