CBoard icon indicating copy to clipboard operation
CBoard copied to clipboard

[经验]ERROR:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

Open bingws opened this issue 6 years ago • 1 comments

原因:用的是mysql5.7.17数据库,存在“0000-00-00 00:00:00”,映射到java.util.Date不识别,所以出错了。 解决方案:jdbc添加“?zeroDateTimeBehavior=convertToNull”解决问题。 tim 20180515174946 tim 20180515175042 tim 20180515175124

bingws avatar May 15 '18 09:05 bingws

还是在程序里添加数据的时候赋上时间字段好,靠表上默认值要求数据库高版本啊; 你这样做貌似只解决了启动时的报错,没解决数据源数据集等处前台操作时的异常吧

hyf002 avatar May 25 '18 05:05 hyf002