JDBC connection to MSSQL 2008 R2 express fails
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 perf开发者_运维知识库ectly. 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?
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
精彩评论