今天来到公司突然发现网站只能列表展示数据没有了,但是根据条件查询单个可以查询到
本地连接线上数据库测试,后台报错:
org.springframework.dao.TransientDataAccessResourceException: Error attempting to get column xxx from result set. Cause: java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date
原来是xxx字段入了0000-00-00 00:00:00 数据导致的
修改jdbc配置为
url: jdbc:mysql://117.71.39.98:9090/xxx?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
成功!