I didn\'t know where to write something about this and decided to do it here.
After loooong time debugging my program I could find out that calling Driver.getConnect
Same problem here (SQLJDBC4, MsSQL 2008 R2, JDK1.6.0.29), but after updating to 1.6.0.30 problem was solved...
So it should be a critical bug in the DriverManager of 1.6.0.29
Upgrading to 1.6.0_30 also worked for me. Microsoft has released a statement announcing the fix in 2012 Q1. It looks like it's a Java vulnerability (BEAST).
I encountered exactly the same behaviour:
I use both Oracle XE and MS SQL Server Express on my Windows 7 64bit PC - I upgraded to java 1.6.0_29 from 1.6.0_27 (the x64 version) and was surprised to see that the same programs where able to connect to Oracle XE but not to MS SQL Server...
I traced down the problem to javax.sql.DataSource.getConnection()
where it was hanging forever - because this is just an interface, the jdbc drivers raised my suspicion...
I'm using the MS SQL Server JDBC Driver 3.0.1301.202 and I even updated to SQL Server CTP (the "community technical preview") 4.0.1722.1 because my suspicion was that it has to do something with the jdbc driver - but no success: still hanging!
My workaround was to downgrade to 1.6.0_27 and -- bang: everything was fine again!
best regards Erich
I had the exact same issue where jBoss would hang on driver.getConnection(). However, I was using jBoss EAP 5.1, java 1.6.0_37x64, Sql Server 2005, and jtds1.2.5 as my jdbc driver.
The work around I had to use was a jvm setting at startup: -Djsse.enableCBCProtection=false and that resolved it.
I don't consider this a fix, but rather a work-around at this point.
I did find a bug: 7105007 : Microsoft & jTDS JDBC driver broken after update to 1.6.0_29 that was very similar, but had a different cause. What was interesting was that it showed up on both the MS drivers and jtds drivers.
Reproduced: Problem occurs with combination of
jTDS SQL Driver 1.2.5
SQL server 2008R2
Java 1.6.0_29
Change either SQL server version (tested on 2005 & 2008) or Java version (1.6.0_27, 1.7.0_1), and the problem doesn't occur anymore.
Client / Server OS: Windows 2008R2
Added to the Java Bug Database and is being worked on by Oracle.
Crossposted on Microsoft MSDN Data Access Forum (accepted answer: upgrade to java 7) and Oracle Java JDBC Forums (information that is added here, is also added to the Java Bug Database).
As an FYI, it appears that there's a new step build #30 in the 1.6 family which fixes the issue: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7103725