This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes Diffrences among drivers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Diffrences among drivers" Watch "Diffrences among drivers" New topic
Author

Diffrences among drivers

Hareesh Ram Chanchali
Ranch Hand

Joined: Jan 31, 2005
Posts: 110
hi,
if i want to write an application which is independent of all 4 types of drivers..(my application do not know about my table DDL and I am able to get it through Reverse Engineering the data model), so now i want to populate the data into the oracle database ( should work with all 4 drivers). How should deal with different sets of data types and while inserting how should i write a generic coding to support any data type.

please help me if possible code also for better understanding


thanks in advance


Hareesh Ram Chanchali
SCJP 5.0, IBM Certified Solution Designer
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Can I ask why you need to support all 4 types of driver with your application? Usually, you would package the appropriate driver with your application code so don't need to worry about this. How for example can you use a Type 1 driver without knowing that the necessary native code is installed on the client machine? Only a type 4 driver can be used without any dependancies.
[ March 17, 2005: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Hareesh Ram Chanchali
Ranch Hand

Joined: Jan 31, 2005
Posts: 110
MAY BE U ARE RIGHT ..

mY INTENTION IS TO MAKE MY APPLICATION WORK WITH ALL THE DRIVERS SO THAT WE CAN PROVIDE MORE FLEXIBILITY .

HOW SHOULD I DEAL THE PROBLEMS WITH DIFFERENT DATA TYPES
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
First af all, please use small letters.

I couldn't get you. What kind of flexiblity you want. We likely use DAO pattern for code reusablity and flexiblity. But using all kind of drivers is meaningless. However, all the drivers has different recommendations and applied respectively.

Thanks.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

And as long as you don't use database specific SQL, you can write your app to set the JDBC URL and Driver name via config properties and you should be able to swap drivers in and out and you application wont care. That's the way JDBC was designed.
Hareesh Ram Chanchali
Ranch Hand

Joined: Jan 31, 2005
Posts: 110
thank you guys
 
GeeCON Prague 2014
 
subject: Diffrences among drivers