Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / July 2003

Tip: Looking for answers? Try searching our database.

design for using different dbs

Thread view: 
j - 15 Jul 2003 12:37 GMT
I'd like to get some ideas on best object design for using multiple dbs
e.e. Oracle and Sybase. In the past I've only done some re-writing of
apps to point at either DB and just did some and then use a case
statement, looked at the JDBC driver class name. If it had the word
Sybase in it I did one thing and if it had Oracle in it I did another.

When I start the app I use parameters which tell it the URL for the DB
and which driver to use.

I could use one DB object for each database but I think that would get
unweildy with at lesat 2 methods for each object with whose data is
inthe db, e.g. customer, invoice, line item.

I could write one object for each database so I'd have a sybaseCustomer,
 oracleCutomer etc.

Then were do you make the decision? Do I use and object factory that
knows about which of the two to use?

ObjectFActory.getObject("Customer");

Just looking for advice fromthose that have been down the road before.

Thank
jw
J - 16 Jul 2003 00:39 GMT
IWith my web app, I use Hibernate for all my database/object mapping.  So
when I need to use a different database, I change the properties file for
Hibernate.  Then the system will use the correct database.

Makes writing db objects so easy, and makes the switching between dbs a
little easier.

J
Ed Yu - 16 Jul 2003 02:37 GMT
I've written a little white paper on how this can be achieved.

http://www.asg.sc.edu/pdf/DatabaseIndependence.pdf

Good luck!

> I'd like to get some ideas on best object design for using multiple dbs
> e.e. Oracle and Sybase. In the past I've only done some re-writing of
[quoted text clipped - 21 lines]
> Thank
> jw


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.