This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes JDBC connection with SQL Server 2008 R2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC connection with SQL Server 2008 R2" Watch "JDBC connection with SQL Server 2008 R2" New topic
Author

JDBC connection with SQL Server 2008 R2

George Nieuwoudt
Greenhorn

Joined: Nov 24, 2011
Posts: 8

Hi,

I have a problem connecting to a database on a sql server 2008 r2 machine, and was wondering if anyone could shed some light on it...

I am currently using eclipse(64 bit), jdk 1.6 update 27(64 bit) and microsoft sql server jdbc 3.0(sqljdbc4) driver to connect to the database but it seems i cannot make a connection or the connection "hangs" because the code does not get executed past trying to make a connection and does not return any errors(even after waiting an hour)...

We have multiple databases on the above mentioned sql server. Which is where i want to connect to a specific one.

code sample ammended:


Any light on this will be apreciated...

Thank You
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Since this is more related to JDBC, let's move it to the JDBC forum.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
George Nieuwoudt
Greenhorn

Joined: Nov 24, 2011
Posts: 8

Thank you, new to here, so will check more carefully next time.
Howard Watson
Ranch Hand

Joined: Jan 07, 2004
Posts: 56
Hi George. Based on my own experience with the Microsoft JDBC driver I recommend trying this driver.

http://jtds.sourceforge.net/
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

JTDS? Yes, I agree. The Microsoft driver used an SSL connection, which for some reason failed in my environment, but when I switched to JTDS that problem went away.
George Nieuwoudt
Greenhorn

Joined: Nov 24, 2011
Posts: 8

Thank you guys, i really apreciate the help jtds is working 100%.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Elena Irkovskaya,
Your post was moved to a new topic.
 
Don't get me started about those stupid light bulbs.
 
subject: JDBC connection with SQL Server 2008 R2