spring:
datasource:
dynamic:
primary: master
datasource:
master:
url: jdbc:oracle:thin:@127.0.0.1:1521/orcl
username: master
password: 123456
driverClassName: oracle.jdbc.OracleDriver
druid:
initialSize: 10
minIdle: 10
maxActive: 30
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 1 from dual
testWhileIdle: true
testOnBorrow: true
testOnReturn: true
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat,wall,slf4j,config
useGlobalDataSourceStat: true
stat:
log-slow-sql: true
merge-sql: true
slow-sql-millis: 10000
slave:
url: jdbc:oracle:thin:@127.0.0.1/orcl
username: slave
password: 123456
driverClassName: oracle.jdbc.OracleDriver
druid:
initialSize: 10
minIdle: 10
maxActive: 30
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 1 from dual
testWhileIdle: true
testOnBorrow: true
testOnReturn: true
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat,wall,slf4j,config
useGlobalDataSourceStat: true
stat:
log-slow-sql: true
merge-sql: true
slow-sql-millis: 10000
logging:
config: classpath:logback-spring.xml
level:
root: info
com.ge: info
多数据的时候,druid配置放在每个库得地下,否则不生效。