Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
476 views
in Technique[技术] by (71.8m points)

sql server - 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.

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.

Full enviroment:

  • OS: Tested on both redhat 6.1 and Windows 2008

  • Driver: MS SQL Server JDBC Driver version 3.0.1301.101

  • Java Versions: 1.6.0_26 and 1.6.0_29

As I previously told it works with 1.6.0_26.

Is there anyone that has any idea what's possibly causing this? Maybe some developer? :p

Best regards,

Rui

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...