Configure datasource of JBOSS application server dynamically

Hi Experts,
      Iam using JBoss application server version 4.1. I have a requirement where depending upon  login credentials i need to configure datasource dynamically. Right now iam configuring datasource in a file named "projectName-ds.xml". Actually different databases means different schemas in the same database. Iam using IBM DB2 version 8.2 database server. Please help me out in this issue.

Thanks in advance,
Rave.
Ravi Kiran Reddy KatkuriAnalyst ProgrammerAsked:
Who is Participating?
 
greyfairerCommented:
JBoss can transfer web login credentials to database logins. Could you make a database login for each web user? And then assign the correct default schema to each user in the database?

Another, simpler solution, would be to duplicate your datasources, that is, have a different datasource for each schema, and depending on the user roles selecting a different datasource.
0
 
TimYatesCommented:
I would go for greyfairer's 2nd option, as it sounds like a more scalable solution

(no points for this if you go with it, I'm just expressing an opinion) :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.