在spring中,在JDBC使用的时候有时候会出现java.sql.SQLException: The server time zone value ‘???ú±ê×??±??’ is unrecognized or represents…的错误。
出现这个的原因是因为 mysql返回的时间总是有问题,比实际时间要早8小时。
解决:
jdbc:mysql://localhost:3306/jdbc01?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8