SpringBoot整合连接池:hikari连接池的使用

添加数据库相关依赖

  <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.32</version>
        </dependency>

application.yml配置文件


spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/one
    data-username: root
    data-password: admin123
原文地址:https://www.cnblogs.com/lyd447113735/p/14477696.html