MYSQL:Cannot convert value ‘0000-00-00 00:00:00’ from column 10 to TIMESTAMP
If the date field in the database is empty and the value is '0000-00-00 00:00:00', the query will return: Cannot convert value '0000-00-00 00:00:00' from column 10 to TIMESTAMP
Solution:
Change the way to connect to the database
Add a parameter after connection: jdbc:mysql://127.0.0.1:3306/test
zeroDateTimeBehavior=convertToNull
That is to change to:
jdbc:mysql://127.0.0.1:3306/test?zeroDateTimeBehavior=convertToNul