I have one database that has many schemas, one per client. We want to create a web开发者_StackOverflow application to be access online by the clients, the application should get the schema on runtime, I think in use Springframework
and Hibernate
to access the database. It's possible to use hibernate to make this works? Exist another framework for this?
Hibernate gets all JDBC connections from a connection factory, and this connection factory settings determine the DB schema against which all Hibernate queries/updates are issued. You can configure your application with multiple SessionFactory
instances, each with a connection factory pointing to a different database schema. Then at runtime, you can pick one the appropriate SessionFactory
to work with.
A simpler solution would be to run multiple copies of your web application, one for each client.
精彩评论