1. 程式人生 > >錯誤:SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

錯誤:SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

解決方法:在jdbc.url後面,加上zeroDateTimeBehavior=convertToNull。

例如:

jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull