Bean managed entity beans with pooled connections. Make yourself a
ConnectionFactory object that does jndi
lookups based on what user settings and do your query after that.

This will, as long as the db.schema is identical work without modifying your
sql....

Klaus

-----Opprinnelig melding-----
Fra: Christian Kvalheim [mailto:[EMAIL PROTECTED]]
Sendt: 26. oktober 2000 10:56
Til: Orion-Interest
Emne: How does one change the database that the EJB is connecting to
during runtime ?


Hey..

I'm in the middle of developing the next version of
our software platform for quality management and I
have run into the following problem. The current
development platform is ASP/COM but we are moving to
J2EE and orionserver as our platform of choice.

This is the problem

When a user connects to the application, he chooses
the company that he belongs to. This sets the context
of the program to point to the database of that
company and all operations are performed on that
database.

This if Company A has the database 'COMPANYA' and
Company B has the database 'COMPANYB' users belonging
to company A will be using the data in COMPANYA when
performing EJB transactions, While Users in Company B
will use COMPANYB when performing EJB transactions.

Now the problem lies in my tellin the EJB to use
database COMPANYB when a user from company B logs on
and COMPANYA whem a user from company A logs on. Of
course we are talking about hundreds and hopefully
thousands of databases over time, so the context must
be possible to switch easily.

Can I do this someway with EJB, without resulting to
the situation of modifying SQL sentences.

Christian Kvalheim
Qm plus

__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

Reply via email to