This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes can I change JDBC Driver ?  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "can I change JDBC Driver ?  " Watch "can I change JDBC Driver ?  " New topic

can I change JDBC Driver ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

In my application i am using JDBC-ODBC bridge and in the ODBC Data source I am selecting a SQL Server driver, I have told that I should use native driver to connect to MSSQL under windows rather than JDBC-ODBC, so now my question is if i changed the driver does it will break my code because my code heavily use commands to communicate with DB ?
and also for MSSQL which driver should I use which will give me a better performance than JDBC-ODBC bridge ?
and if any one knows any help tutorial which shows how to use that driver than that will be awesome.

The Only way to learn is!
Visit my blog
Tim Moores

Joined: Sep 21, 2011
Posts: 2417
I wouldn't use a native driver for anything these days; type 4 drivers have become very good over the years. Microsoft provides one for SQLServer free of charge. I don't think there should be any significant problems substituting one driver for the other.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20279

I think that with "native driver" Naved meant a driver dedicated for that particular RDMS.

Provided you only used the interfaces from the java.sql and javax.sql packages and kept the database specific code limited to the loaded class and connection String, then the only thing that could break code would be any RDMS specific queries. I've worked with an older Oracle RDMS that didn't support joins the regular way with INNER JOIN and LEFT OUTER JOIN; instead it used a WHERE clause with a (+) after a column to indicate a LEFT or RIGHT OUTER JOIN. For instance, would translate to . Unless you have that such an RDMS you should be just fine.

How To Ask Questions How To Answer Questions
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3733

The suggestion to use a "native driver" came probably from me in the other thread started by Naved. I'm very sorry for the confusion, by "native driver" I actually did mean the "type 4 driver".
I agree. Here's the link:
subject: can I change JDBC Driver ?
It's not a secret anymore!