1. 程式人生 > >處理selectByExample()方法報資料庫異常

處理selectByExample()方法報資料庫異常

異常資訊:org.springframework.dao.TransientDataAccessResourceException: Error attempting to get column 'req_end' from result set.  Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp ; SQL []; Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp; nested exception is java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

解決方案:檢視資料庫裡面的日期型別的資料是否是“0000-00-00 00:00:00”,將其改為正常日期時間即可。