javaweb项目中java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. 异常,如下图:

Javaweb项目中出现java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.异常

 

服务器时区值“????±××?±?无法识别或代表一个以上的时区。如果希望利用时区支持,则必须配置服务器或JDBC驱动程序(通过serverTimezone配置属性)以使用更具体的时区值。

修改从c3p0-config.xml配置文件

 <default-config>
     <property name="driverClass">com.mysql.jdbc.Driver</property>
     <property name="jdbcUrl">jdbc:mysql://localhost/hejh
     ?useUnicode=true&amp;useJDBCCompliantTimezoneShift=true&amp;useLegacyDatetimeCode=false&amp;serverTimezone=UTC</property>
     <property name="user">root</property>
     <property name="password">root</property>
    
    
    <property name="initialPoolSize">20</property>
    <property name="maxIdleTime">30</property>
    <property name="maxPoolSize">100</property>
    <property name="minPoolSize">10</property>
    <property name="maxStatements">200</property>
  </default-config>

即可。

 

相关文章:

  • 2021-12-16
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
猜你喜欢
  • 2021-10-05
  • 2022-12-23
  • 2021-08-12
  • 2021-09-10
相关资源
相似解决方案