与 MSSQL 2008 R2 Express 的 JDBC 连接失败
我正在尝试连接到本地计算机上的 MS SQL 2008 R2 Express 服务器(Win7 Prof 64 位,MSSQL=64 位)。此操作失败并显示“连接被拒绝:连接”
该问题与此帖子相同: 无法使用 JDBC 连接到 msql 2008 express
不幸的是,解决方案该帖子不适用于我的情况。 TCP/IP 已在端口 1433 上启用,没有活动的防火墙。我正在使用 MS JDBC 驱动程序 3.0。与 Mgmt Studio 或通过 C++ 和 OleDB 连接效果很好。我已按照网络上其他一些帖子中的建议来检查 telnet。命令“telnet localhost 1433”返回相同的错误。
所以这可能不是一个普通的 jdbc 问题,而可能更多是一个 SQL Server 问题。
一种想法是,这可能与运行 64 位 Win7 的机器有关。
无论如何,我被困住了。还有什么提示我可以检查或尝试吗?
I'm trying to connect to a MS SQL 2008 R2 Express server on my local machine (Win7 Prof 64bit, MSSQL=64bit, too). This fails with 'Connection refused: connect'
The issue is identical to this post:
Cannot connect to msql 2008 express with JDBC
Unfortunately the solution in that post doesn't work in my case. TCP/IP has been enabled on port 1433 already, no firewall is active. I'm using MS JDBC driver 3.0. Connecting with Mgmt Studio or via C++ and OleDB works perfectly. I've followed the suggestion in some other posts on the web to check with telnet. The command 'telnet localhost 1433' returns the same error.
So it could be this is not a plain jdbc issue but maybe more of an SQL Server issue.
One idea is that it could have to do with the machine running under 64bit Win7.
Anyway, I'm stuck. Any hints what else I could check or try?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用更高版本的 Java。
我遇到了类似的问题,首先使用 Java 1.6.0_27 Squirrel SQL 只是无限期地挂起“正在连接”消息。重新启动 SQLExpress 会使 Squirrel 断开连接,证明它已连接。正如 Process Explorer 显示 Java 进程一样,它也显示它已连接。
更新到 Java 1.6.0_31 第一次尝试连接良好。
另请参阅此:
Driver.getConnection 使用 SQLServer 驱动程序挂起,并且Java 1.6.0_29
Try using a later Java.
I had a similar problem, first using Java 1.6.0_27 Squirrel SQL was just hanging undefinitely with "Connecting" message. Restarting the SQLExpress would make Squirrel break the connection, proving that it was connected. Just as well Process Explorer was showing the Java process was also showing it was connected.
Updating to Java 1.6.0_31 it connected fine first attempt.
Also see this:
Driver.getConnection hangs using SQLServer driver and Java 1.6.0_29