File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes How to Connect SQL Server with java using JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to Connect SQL Server with java using JDBC" Watch "How to Connect SQL Server with java using JDBC" New topic

How to Connect SQL Server with java using JDBC

Loveen Jain
Ranch Hand

Joined: Jan 24, 2004
Posts: 35
I am new in this room, earlier i was active in the Beginners room and the SCJP room, now i think that i have grown up to be in intemediate's room please help me out with the following querry:
I dont know how to connect a java program with Microsoft SQL server using JDBC please help me out!!!

Billybob Marshall
Ranch Hand

Joined: Jan 27, 2004
Posts: 202
As far as I know, SQL Server, being a MS product, does not supply a direct JDBC driver, so you'd have to use the jdbc-odbc bridge driver which Sun (I think) provides. Search the web for 'jdbc odbc bridge', or maybe someone else will answer you more directly.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Moving to JDBC

[Jess in Action][AskingGoodQuestions]
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
I have used MSSQL Driver from MS sometime back when it was just released first in Beta version. They do have one for JDBC.
here you go
Try to see if that works. the file is called mssqlserver.tar I guess.
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
Microsoft has a JDBC driver that is supposed to work with both Unix and Windows. I am not sure if it is free
My company uses an old jdbc driver called
We use it to call only one small stored procedure. We do not own the SQL Server database, in our case...
U can also find other commerical jdbc drivers as well for SQL Server, though Surprisingly
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Download the MS SQL 2000 Server JDBC Driver from here. As it is a Microsoft product, it "installs" the files and creates shortcuts to the documentation. You will need to read it's documentation to learn how to construct the connection URL and what Driver package to use.
Next, go through the JDBC Tutorial on suns site.
When you have specific questions about the code you are working on (problems, errors, exceptions, etc) give us a shout.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: How to Connect SQL Server with java using JDBC
It's not a secret anymore!