Javaweb项目中出现java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represe...

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 represe..._第1张图片

 

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

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

 <default-config>
     com.mysql.jdbc.Driver
     jdbc:mysql://localhost/hejh
     ?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
     root
     root
    
    
    20
    30
    100
    10
    200
  default-config>

即可。

 

转载于:https://www.cnblogs.com/hejh/p/11346332.html

你可能感兴趣的:(Javaweb项目中出现java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represe...)