We have a struts-hibernate-mysql application running on tomcat. We want to have the same codebase for the application but would like to have the application connect to different databases dynamically based on the user who logs in into the system.
Basically we would like to have different databases for each different school. The database for each school would be big hence we have decided to have database for each school separate but the Java code base to be same. Hence we would not like to have multiple instances of the Web application deployed on tomcat but a single application should be able to connect to various databases depending on the person who logins.
How can this be achieved?