简体   繁体   中英

h2 database and sql server in spring boot

I was asked this question by a colleague, and I am unable to answer it:

I have an in memory database (h2), and I have a SQL database server which our app needs to talk too. But due to the two different SQL dialects we are now wondering how do we get around the issue by doing the least amount of work?

This to be done in spring boot. I am aware of how to connect to the h2 database and SQL database server, but I am unsure on the rest.

If everything is setup by Spring, you should not be worried about the 2 different SQL dialects. Just be sure that spring.jpa.database is set to default to let Spring autodetect the right dialect for each datasource.

Here's a link that explain how to use/initialize two datasource in a Spring Boot projet if you need some more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM