当前位置:   article > 正文

spring boot连接多个数据库_spring boot访问多个数据库用户

spring boot访问多个数据库用户

yml配置

spring:
  datasource:
    main:
      url: jdbc:mysql://222.128.10.8:8366/abutment_biz?useSSL=false
      username: root
      password: xxxxx
      driver-class-name: com.mysql.jdbc.Driver
    bigdata:
      url: jdbc:mysql://222.128.10.8:8366/abutment?useSSL=false
      username: root
      password: xxxxx
      driver-class-name: com.mysql.jdbc.Driver
    statistical:
      url: jdbc:mysql://222.128.10.8:8366/business_result?useSSL=false
      username: root
      password: xxxxx
      driver-class-name: com.mysql.jdbc.Driver
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

多数据源配置

package com.zjht.abutment.config;

import javax.sql.DataSource;

import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.beans.factory.annotation
  • 1
  • 2
  • 3
  • 4
  • 5
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/857143
推荐阅读
相关标签
  

闽ICP备14008679号