springboot配置多数据源mysql,presto,hive等

下面案例是配置多数据源,两个及以上,但是主数据源只能是一个,默认mybatis使用的是主数据源 下面配置mysql为主数据源,通过注解@Primary标注 yaml文件配置: spring: datasource: mysqlMain: #mysql主数据源,可关联mybatis type: com
posted @ 2022-10-13 10:28  wss96  阅读(1212)  评论(2编辑  收藏  举报