Dynamically connection to multiple databases from single J2ee Application

Dear sirs,

I have a J2ee application which is running in JBOSS Server. The Data tier is MySql. We are using CMP

Now the scenario is like this,

We are having two clients, and the clients have different sub users. The clients are using two seperate database for the same application. Now the application is working in two different servers assigned for each clients. Now we are planning to integrate it to a single application . I would like to know whether

1. Is it possible to specify the JNDI names for more than one database in the deployement descriptor?

2. if it is then, how can we instruct the container to lookup dynamically for the appropriate database based on the user logged in to the application .

I am planning to setup a new DB for the users information sothat the container can select the appropriate DB based on the user logged in...

Thankyou,

Sudheesh K S,

[929 byte] By [sudheeshk_sa] at [2007-10-2 0:51:34]
# 1
The different EJBs in the deployment descriptor may refer different JNDI datasources which are defined in datasource files for different databases in the deploy directory.
dvohra09a at 2007-7-15 18:11:06 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...