It is possible. For each database you would need a seperate Hibernate Configuration, pointing at a different DB. Each configuration would be it's own SessionFactory.
How you actually set it up can get complicated. Off the top of my head, I would just hardcode each configuration for each client, and depending on who logs in use the appropriate SessionFactory that is already in the JVM.
If there are too many clients you would probably have to devise some sort of SessionFactory pool, that creates a NEW SessionFactory if he is the only user hitting DB1. If another user logs on and needs DB1, the SessionFactory would already be there and he would take part in it. When no other users needs DB1, the SessionFactory would be destroyed (to save memory).
The main point to remember is that it's a 1-1-1 relationship of Configurations-SessionFactory-Database.
_________________ - Jonathan
|