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 jdbc/odbc to sql server 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 "jdbc/odbc to sql server" Watch "jdbc/odbc to sql server" New topic

jdbc/odbc to sql server

jenny brad
Ranch Hand

Joined: Jun 24, 2006
Posts: 30
The enviornment is all windows and we have to use MS sql server for db. where can I find the code for the connection using jdbc/odbc driver? is this a good choice?

anyone having experience, please shade some lights. thanks.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

Moving to our JDBC forum.

[Jess in Action][AskingGoodQuestions]
jenny brad
Ranch Hand

Joined: Jun 24, 2006
Posts: 30
I downloaded sql server JDBC driver and put the following code to test:

Connection connection = DriverManager.getConnection(

but it says " can't be resolved to a type". what is the problem?
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
The instructions for connecting are slightly different, depending on whether you are using SQL Server 2000, or SQL Server 2005

Here are some resources that explain it all.

SQL Server 2000;en-us;313100

SQL Server 2005

You can also use the jTDS driver with both. Many people seem to prefer it with SQL Server 2000. The 2005 driver is much improved and I don't know a consensus that jTDS is or is not better than the 2005 driver.
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 862
for an open source type 4 driver that doesn't require odbc check out jtds. - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
I agree. Here's the link:
subject: jdbc/odbc to sql server
It's not a secret anymore!