My team is planning to develop an order management application for a specific domain. Here we have our own database(Oracle) for the data capturing purpose. Currently we are planning to use DAO,TO and Singleton pattern (plus other as progresses). But during analysis we got to know that we have to pick certain data from other database (MySQL) in a order entry form at run time against a business key. So here, we are expecting 2 database connection (Using JNDI), one (Oracle) for the whole application and second (MySQL) for one time, at the time of order entry.
So, My query how to intermingle with DAO pattern (if possible) with 2 connections, or will it require some other pattern?
Waiting for your reply....
Joined: Apr 16, 2008
Your implementation of the Data Access Object design pattern will need to be able to handle communication with two databases. Whenever your business object communicated with a DAO, it will need to indicate which database it should work with. This can be done via method signature in the DAO call.
Joined: Oct 08, 2006
Just create one DAO instance for one DB and another DAO instance for another DB.
If this doesn't fit in your current DAO design, then it might be plain flawed. To start, only the word 'singleton' in combination with 'DAO' already doesn't sound very good.