Hi,
I need to select the datasource based on from which contextpath the request is coming in.
We have 2 identical DBs for 2 different web-apps both running in parallel. We are using Jboss/Hibernate/MySql.
If i need to make changes at the MySQL level, then i'll have to make changes in mysql-ds.xml.
If i need to make changes at the Hibernate level, then i'll have to make changes in Hibernate-cfg.xml
I am not sure which approach to take and what changes i need to make. Please help.
Is there a way, i can get the contextpath randomly at some point in my code(not extending servlet). If this is possible, then i can make minor changes in the code and ignore the above two approaches.
Thanks.
|