c3p0报错:java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents m

报错是因为你的jdbc版本问题
所以应该在url应该加上?serverTimezone=Asia/Shanghai

<?xml version="1.0" encoding="UTF-8"?>
<c3p0-config>
  <default-config>
    <property name="driverClass">com.mysql.cj.jdbc.Driver</property>
    <property name="jdbcUrl">jdbc:mysql://localhost:3306/db1?serverTimezone=Asia/Shanghai</property>
    <property name="user">root</property>
    <property name="password">root</property>

    <property name="initialPoolSize">10</property>
    <property name="maxIdleTime">30</property>
    <property name="maxPoolSize">20</property>
    <property name="minPoolSize">5</property>
    <property name="maxStatements">200</property>
  </default-config>

  <named-config name="mysql">
    <property name="acquireIncrement">50</property>
    <property name="initialPoolSize">100</property>
    <property name="minPoolSize">50</property>
    <property name="maxPoolSize">1000</property><!-- intergalactoApp adopts a different approach to configuring statement caching -->
    <property name="maxStatements">0</property>
    <property name="maxStatementsPerConnection">5</property>
  </named-config>

  <named-config name="oracle">
    <property name="acquireIncrement">50</property>
    <property name="initialPoolSize">100</property>
    <property name="minPoolSize">50</property>
    <property name="maxPoolSize">1000</property><!-- intergalactoApp adopts a different approach to configuring statement caching -->
    <property name="maxStatements">0</property>
    <property name="maxStatementsPerConnection">5</property>
  </named-config>
</c3p0-config>

你可能感兴趣的:(JDBC)