使用java来编写配置是很有必要的,请先参考: 在Spring中使用@Configuration注解加载JavaConfig配置
Spring Boot 自定义数据源 DruidDataSource
spring bean加载顺序解决办法笔记
Druid连接池基本配置