springboot2.0配置连接池(hikari、druid)

HikariDataSource

https://www.cnblogs.com/blog5277/p/10660689.html

spring:
    datasource:
        driver-class-name: oracle.jdbc.driver.OracleDriver
        url: jdbc:oracle:thin:@192.168.3.130:1521:topicis
        username: TOPPORTAL
        password: 123456
        type: com.zaxxer.hikari.HikariDataSource
        hikari:
          minimum-idle: 20
          maximum-pool-size: 500
          auto-commit: true
          idle-timeout: 30000
          max-lifetime: 1800000
          connection-timeout: 30000
          connection-test-query: select 1 from dual
          pool-name: HikariCP

 

druid-spring-boot-starter

https://blog.csdn.net/weixin_38187317/article/details/81562571

 


   com.alibaba
   druid-spring-boot-starter
   1.1.10

spring:
    datasource:
        driver-class-name: oracle.jdbc.driver.OracleDriver
        url: jdbc:oracle:thin:@192.168.16.205:49161:XE
        username: YUE9
        password: 123456
        type: com.alibaba.druid.pool.DruidDataSource
        druid:
          initial-size: 5
          min-idle: 5
          maxActive: 20
          maxWait: 60000
          timeBetweenEvictionRunsMillis: 60000
          minEvictableIdleTimeMillis: 300000
          validationQuery: SELECT 1 FROM DUAL
          testWhileIdle: true
          testOnBorrow: false
          testOnReturn: false
          poolPreparedStatements: true
          maxPoolPreparedStatementPerConnectionSize: 20
          filters: stat,wall,log4j
          connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
          web-stat-filter:
            enabled: true
            url-pattern: "/*"
            exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
          stat-view-servlet:
            url-pattern: "/druid/*"
            allow: 127.0.0.1,localhost
            deny: 192.168.1.73
            reset-enable: false
            login-username: admin
            login-password: 123456

 

你可能感兴趣的:(java)