build.gradle
implementation ('org.springframework.boot:spring-boot-starter-jdbc') {
exclude group: 'com.zaxxer', module: 'HikariCP'
}
implementation group: 'org.apache.commons', name: 'commons-dbcp2', version: '2.9.0'
application.yaml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3380/testdb
username: root
password: test
dbcp2:
initial-size: 5
max-total: 10
test-while-idle: true
time-between-eviction-runs-millis: 1000
num-tests-per-eviction-run: 1