I am using mysql as my datasource. Databases are created dynamically and the details saved in a main database table. A user can log in to the system and connect to any database. The requirement is to connect to any of this databases at application level using hibernate. At any one time we don't know the number or names of databases except fetch them from the main scheme and pass the value to create a new connection like this.
Connection conn=connectDatabase(db1);
Connection conn=connectDatabase(db2);
I know it can be done but I don't how. The problem is how to do this using hibernate.