首页 > 技术文章 > java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp

wangjinyu 2018-12-17 09:05 原文

java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp 错误是因为时间类型出现了0000-00-00 00:00:00 而在hibernate将结果映射成实体时,会认为此种格式不是正确的java.sql.Timestamp,固会报错

解决方式是在url后添加&zeroDateTimeBehavior=convertToNull

 

推荐阅读