DAO's

As DAO's is Core J2EE design pattern ,if i have 2 databases then where i configure the info which database i have to use. based on config ingo i have to connect to corresponding database at run-time
[220 byte] By [veerjaa] at [2007-11-26 15:46:54]
# 1
fascinating
shoopy.a at 2007-7-8 22:06:19 > top of Java-index,Java Essentials,New To Java...
# 2
FEED ME DUKES
shoopy.a at 2007-7-8 22:06:19 > top of Java-index,Java Essentials,New To Java...
# 3

> As DAO's is Core J2EE design pattern ,

>

> if i have 2 databases then where i configure the

> info which database i have to use.

>

> based on config ingo i have to connect to

> corresponding database at run-time

As with one database, you'd use JNDI for lookup of the datasources (each database = a datasource).

At the DAO level, you could use two subclasses of a generic DAO interface/abstract class for each datasource, e.g. OracleDAO or MySqlDAO...

karma-9a at 2007-7-8 22:06:19 > top of Java-index,Java Essentials,New To Java...