Spring Boot 整合 Mybatis (三) druid-spring-boot-starter Druid数据源 野性酷女 2022-03-10 16:44 196阅读 0赞 ***[https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter][https_github.com_alibaba_druid_tree_master_druid-spring-boot-starter]*** # **1.maven依赖** # <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.10</version> </dependency> # 2.application.yml配置 # spring: application: name: mybatis-server datasource: driverClassName: com.mysql.jdbc.Driver url: jdbc:mysql://localhost:3306/flowable_demo?useUnicode=true&characterEncoding=utf-8 username: root password: admin123456 #druid配置 druid: initial-size: 5 min-idle: 10 max-active: 20 max-wait: 60000 timeBetweenEvictionRunsMillis: 600000 minEvictableIdleTimeMillis: 300000 validationQuery: select 1 testWhileIdle: true testOnBorrow: false testOnReturn: false poolPreparedStatements: true maxOpenPreparedStatements: 20 async-init: false web-stat-filter: enabled: true stat-view-servlet: enabled: true server: port: 8081 # **3.启动[http://127.0.0.1:8081/druid/index.html][http_127.0.0.1_8081_druid_index.html]** # ![watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTA5NTc2NDU_size_16_color_FFFFFF_t_70][] [https_github.com_alibaba_druid_tree_master_druid-spring-boot-starter]: https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter [http_127.0.0.1_8081_druid_index.html]: http://127.0.0.1:8081/druid/index.html [watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTA5NTc2NDU_size_16_color_FFFFFF_t_70]: /images/20220310/c2596fdaeb7641369f22a5f255326137.png
还没有评论,来说两句吧...