Mybatisplus configuring multiple data sources (II)

goodlook0123 2022-02-13 08:12:05 阅读数:955

mybatisplus configuring multiple data sources

Today I'm going to share mybatisplus Configure multiple data sources ( By reading the database ). This configuration is suitable for scenarios where the number of data sources is uncertain , But when the data structure model is almost consistent . The scenario used in our project is , A project collection N individual erp database .

The version information used in the project is as follows :



Database master database uses mysql, Multi data source theory supports various databases ( You need to import the corresponding database jar).

So let's see mybatisplus Which databases are supported , By reading the source code DbType You can see that the following screenshot database is supported :

Introduction in case SqlServer and MySQL, Need to be in pom introduce jar

<!--druid introduce -->
copyright:author[goodlook0123],Please bring the original link to reprint, thank you.