标签:use tor time 数据 username dao层 boot utf-8 mysq
数据源配置:
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.one.url=jdbc:mysql://127.0.0.1:3306/111?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&serverTimezone=UTC
spring.datasource.one.username=root
spring.datasource.one.password=root
spring.datasource.two.url=jdbc:mysql://127.0.0.1:3306/222?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&serverTimezone=UTC
spring.datasource.two.username=root
spring.datasource.two.password=root
dao层调用:
@Autowired
@Qualifier("jdbcTemplateOne")
JdbcTemplate jdbcTemplateOne;
@Resource(name = "jdbcTemplateTwo")
JdbcTemplate jdbcTemplateTwo;
标签:use tor time 数据 username dao层 boot utf-8 mysq
原文地址:https://www.cnblogs.com/-llf/p/13839543.html