美文网首页
SpringBoot +Druid

SpringBoot +Druid

作者: 忘记_3a6a | 来源:发表于2020-03-17 20:54 被阅读0次
    • pom.xml
    <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid-spring-boot-starter</artifactId>
                <version>1.1.10</version>
            </dependency>
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <scope>runtime</scope>
            </dependency>
    
    • application.yml
    spring:
      datasource:
        druid:
          url: jdbc:mysql://ip:port/dbname?useUnicode=true&characterEncoding=utf-8&useSSL=false
          username: root
          password: 123456
          initial-size: 1
          min-idle: 1
          max-active: 20
          test-on-borrow: true
          # MySQL 8.x: com.mysql.cj.jdbc.Driver
          driver-class-name: com.mysql.jdbc.Driver
    

    相关文章

      网友评论

          本文标题:SpringBoot +Druid

          本文链接:https://www.haomeiwen.com/subject/hwmxyhtx.html