How to switch Database on runtime in SpringBoot and SpringDataJPA / Hibernate?

≯℡__Kan透↙ 提交于 2019-12-29 01:45:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!