Driver.getConnection 使用 SQLServer 驱动程序和 Java 1.6.0_29 挂起 [英] Driver.getConnection hangs using SQLServer driver and Java 1.6.0_29
问题描述
我不知道在哪里写点什么,决定在这里写.
I didn't know where to write something about this and decided to do it here.
经过长时间调试我的程序后,我发现调用 Driver.getConnection(string, string, string) 会挂起调用线程.为什么(?),我真的不知道,但我可以发现这发生在 java 1.6.0_29 而不是 java 1.6.0_26.
After loooong time debugging my program I could find out that calling Driver.getConnection(string, string, string) hangs the calling thread. Why(?), I really don't know, but I could find out that this happens with java 1.6.0_29 and not with java 1.6.0_26.
完整环境:
操作系统:在 redhat 6.1 和 Windows 2008 上测试
OS: Tested on both redhat 6.1 and Windows 2008
驱动程序:MS SQL Server JDBC 驱动程序版本 3.0.1301.101
Driver: MS SQL Server JDBC Driver version 3.0.1301.101
Java 版本:1.6.0_26 和 1.6.0_29
Java Versions: 1.6.0_26 and 1.6.0_29
正如我之前所说,它适用于 1.6.0_26.
As I previously told it works with 1.6.0_26.
有没有人知道可能导致这种情况的原因?也许是一些开发人员?:p
Is there anyone that has any idea what's possibly causing this? Maybe some developer? :p
最好的问候,
锐
推荐答案
我遇到了完全相同的行为:
I encountered exactly the same behaviour:
我在 Windows 7 64 位 PC 上同时使用 Oracle XE 和 MS SQL Server Express - 我从 1.6.0_27(x64 版本)升级到 java 1.6.0_29,并惊讶地看到相同的程序能够连接到Oracle XE 但不适用于 MS SQL Server...
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...
我将问题追溯到 javax.sql.DataSource.getConnection()
在那里它永远挂起 - 因为这只是一个接口,jdbc 驱动程序引起了我的怀疑......
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...
我正在使用 MS SQL Server JDBC 驱动程序 3.0.1301.202,我什至更新到 SQL Server CTP(社区技术预览")4.0.1722.1,因为我怀疑它必须对 jdbc 驱动程序执行某些操作 -但没有成功:仍然挂!
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!
我的解决方法是降级到 1.6.0_27 并且 -- 砰:一切又好起来了!
My workaround was to downgrade to 1.6.0_27 and -- bang: everything was fine again!
最好的问候埃里希
这篇关于Driver.getConnection 使用 SQLServer 驱动程序和 Java 1.6.0_29 挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!