1.再properties配置文件种配置:

c3p0.jdbcUrl=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
c3p0.user=root
c3p0.password=20140813
c3p0.driverClass=com.mysql.jdbc.Driver
c3p0.minPoolSize=2
c3p0.maxPoolSize=10
c3p0.maxIdleTime=1800000
c3p0.acquireIncrement=3
c3p0.maxStatements=1000
c3p0.initialPoolSize=3
c3p0.idleConnectionTestPeriod=60
c3p0.acquireRetryAttempts=30
c3p0.acquireRetryDelay=1000
c3p0.breakAfterAcquireFailure=false
c3p0.testConnectionOnCheckout=false

2.在pom.xml中添加c3p0的相关依赖:

springboot配置c3p0数据源


3.书写配置类:

springboot配置c3p0数据源

相关文章:

  • 2021-11-19
  • 2022-01-05
  • 2021-06-21
  • 2021-07-04
  • 2021-09-07
猜你喜欢
  • 2022-01-11
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
  • 2021-10-31
相关资源
相似解决方案