I want to create an application with Java application with Hibernate with multiple databases on runtime.
Actually i am creating multitenant application with following flow:
1- one Applcation may be php: from website user will create account, the system will run the process and will create database and releated configuration.
2- Major application ( Java + hibernate ) will now loaded start pointing to that newly created database which contains users and other stuff data.
3- I want to add oauth2 rest security as well. so the configuration should be acordingly.
now the question is that how to achieve this in Hibernate application and swtich the database configuration on runtime?