File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 2247

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: 51
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: 18127
    
    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: 18127
    
    8

Elena Irkovskaya,
Your post was moved to a new topic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC connection with SQL Server 2008 R2
 
Similar Threads
Updated from JRE 1.5 to 1.6, now SQL JDBC Connection doesnt work
Use only 1 connection to SQL Server (newbie ?)
SQL Server 2008r2 Connection Failed
[Microsoft][ODBC Driver Manager] Invalid string or buffer length exception for 64 bit SQL Server
SQL Server - netbeans Connection problem