Quick fix for “java.sql.SQLException: Value ’0000-00-00′ can not be represented as java.sql.Timestamp”

If you ever run across this while fighting with Hibernate, one quick fix is to instruct JDBC to turn the bad date values into NULLs, eg:

jdbc:mysql://localhost/test?zeroDateTimeBehavior=convertToNull&autoReconnect=true&characterEncoding=UTF-8&characterSetResults=UTF-8

Your mileage side-effects may vary.

More excellent Java + J2EE tips (and lots of other stuff in Czech) here.

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)
Loading ... Loading ...

Possibly Related:


Leave a Reply