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