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)中,右键相关服务,打开属性,在登录选项卡,选择本地系统账户,之后重启服务.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥30 matlab ode45 未发现警告,但是运行出错
- ¥15 vscode platformio
- ¥15 代写uni代码,app唤醒
- ¥15 全志t113i启动qt应用程序提示internal error
- ¥15 ensp可以看看嘛.
- ¥80 51单片机C语言代码解决单片机为AT89C52是清翔单片机
- ¥60 优博讯DT50高通安卓11系统刷完机自动进去fastboot模式
- ¥15 minist数字识别
- ¥15 在安装gym库的pygame时遇到问题,不知道如何解决
- ¥20 uniapp中的webview 使用的是本地的vue页面,在模拟器上显示无法打开