Original link:
http://www.cnblogs.com/niejunlei/p/5986766.html
MySQL datetime query the exception
- 异常:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp (2011-05-25 11:38:40)
- Description: Non-empty default values Datetime type field, the query procedure, to the following error: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- Solution: Add a database connection string zeroDateTimeBehavior parameters or noDatetimeStringSync parameters jdbc: mysql: // host:? Port / xxx ...
- zeroDateTimeBehavior:取值exception、converToNull、round
-
-
- Exception --- throw an exception: the results java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp.
- converToNull : return null value
- round : return 0001-01-0100: 00: 00.0
-
-
- noDatetimeStringSync : set to true, returns 0000-00-00 00:00:00
Reproduced in: https: //www.cnblogs.com/niejunlei/p/5986766.html