Or you could have different bean per datastore.  Same class files but
different deployment descriptors and register the homes under different JNDI
names.

if (username.equals("Elison"))
{
   MyBeanHome home = (MyBeanHome)new
InitialContext().lookup("MyBeanOracle");
   MyBean bean = home.create(blah blah blah);
}
else if (username.equals("Gates"))
{
   MyBeanHome home = (MyBeanHome)new
InitialContext().lookup("MyBeanSQLServer");
}

Just an idea.

Bill

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of marc
> fleury
> Sent: Friday, August 17, 2001 11:23 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [JBoss-dev] (no subject)
>
>
> use BMP and access your datasource by name based on the user,
>
> or write that code for CMP you are the first to require this.
>
>
> marcf
>
>
> |-----Original Message-----
> |From: [EMAIL PROTECTED]
> |[mailto:[EMAIL PROTECTED]]On Behalf Of
> |Robert Xiong
> |Sent: Wednesday, August 15, 2001 1:24 AM
> |To: [EMAIL PROTECTED]
> |Subject: [JBoss-dev] (no subject)
> |
> |
> |Hello,
> |I am new to Jboss and J2EE. Here is my question:
> |Since I have to specify the datasource when I deploy
> |my nean (using CMP), just wondering how can I use the
> |same bean to access diffrent datasource? In a ASP
> |model, different user will access different database
> |schema using the exactly same application. How can we
> |dynamicly allocate a datasource to the bean based on
> |the user login? Does Jaws.xml DTD let us to do that?
> |Thanks for you answer.
> |
> |Robert
> |
> |=====
> |Robert Xiong
> |Sr. Software Engineer
> |
> |__________________________________________________
> |Do You Yahoo!?
> |Make international calls for as low as $.04/minute with Yahoo! Messenger
> |http://phonecard.yahoo.com/
> |
> |_______________________________________________
> |Jboss-development mailing list
> |[EMAIL PROTECTED]
> |http://lists.sourceforge.net/lists/listinfo/jboss-development
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
>



_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to