问题
I want to create an application with SpringBoot, SpringRest, SpringDataJPA / 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 ( SpringBoot, SpringRest, SpringDataJPA / 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 springBoot and springDataJPA application and swtich the database configuration on runtime?
your answers are highly appreciated.
thanks.
来源:https://stackoverflow.com/questions/53297213/how-to-switch-database-on-runtime-in-springboot-and-springdatajpa-hibernate