renren-fast 框架多数据源资料

在常量配置

io.renren.datasources. DataSourceNames
添加 数据源 标志

String '''''FIRST''''' = "first";

String '''''SECOND''''' = "second";

String '''''THIRD''''' = "third";

String '''''FOUTH''''' = "fouth";

在 yml 文件中添加数据源配置

spring:

datasource:

    type: com.alibaba.druid.pool.DruidDataSource

    driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver

    druid:

        first:  #数据源1

            url: jdbc:sqlserver://192.168.1.114:1433;databasename=renren_fast

            username: sa

            password: 123456

        second:  #数据源2

            url: jdbc:sqlserver://192.168.1.114:1433;databasename=HN-SafeExamCore

            username: sa

            password: 123456

        third:   #数据源3

            url: jdbc:sqlserver://192.168.1.114:1433;databasename=renren_fast

            username: sa

            password: 123456

        fouth:   #数据源4

            url: jdbc:sqlserver://192.168.1.114:1433;databasename=renren_fast

            username: sa

            password: 123456

阅读资料

开源项目renren-fast解读,让java不再难懂
https://cloud.tencent.com/developer/news/222766

http://baijiahao.baidu.com/s?id=1601394902050024021&wfr=spider&for=pc

http://baijiahao.baidu.com/s?id=1601503116967379920&wfr=spider&for=pc

多数据源切换

利用切面,动态切换

https://blog.csdn.net/u012075383/article/details/79304178

spring-boot+mybatis-plus+SQLServer多数据源配置

https://blog.csdn.net/MuuMo/article/details/81180020

springBoot 动态数据源以及Mybatis多数据源

https://blog.csdn.net/tengxing007/article/details/78424645

Spring Boot + Mybatis多数据源和动态数据源配置

https://blog.csdn.net/neosmith/article/details/61202084

https://blog.csdn.net/kimylrong/article/details/50471097

SpringBoot+MybatisPlus(多数据源和主从分离)

http://www.cnblogs.com/hsbt2333/p/9347249.html

SpringBoot入门之基于Druid配置Mybatis多数据源

https://www.cnblogs.com/5ishare/p/9352046.html

posted @ 2018-09-13 15:26  lvye1221  阅读(54)  评论(0编辑  收藏  举报