2

I have one database that has many schemas, one per client. We want to create a web 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?

Cyclonecode
  • 29,115
  • 11
  • 72
  • 93
TulioPa
  • 177
  • 9

1 Answers1

0

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.

Binil Thomas
  • 13,699
  • 10
  • 57
  • 70