Closed bigkun closed 5 years ago
You can create more than one different datasource on your application as you want
We use mybatis in our springboot project. I don't known how to configure it . normal tables use normal mybatis connection; sharding tables , mybatis can work with sharding-jdbc.
How to config multiple data source on Mybatis and springboot are Mybatis and springboot's issue. Can you google first? If cannot find way, you can try to search for stackoverflow or talk on springboot or Mybatis's issue
You can get connection from ShardingDataSource(shardingjdbc) in sharding scenario, but fetch connection from other normal DataSource(dbcp、hikariCP、druid...) in non-sharding scenario