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 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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "can I change JDBC Driver ?  " Watch "can I change JDBC Driver ?  " New topic
Author

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.
thanks


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
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
Sheriff

Joined: Oct 27, 2005
Posts: 19718
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

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: http://aspose.com/file-tools
 
subject: can I change JDBC Driver ?