Mysql datetime query exception troubleshooting, mysqldatetime Query
An error occurred while querying mysql datetime.
- Exception: Value '2017-00-00 00:00:00 'can not be represented as java. SQL. Timestamp (0000 11:38:40)
- Description: non-null Datetime type field without default Value. The program reports the following error during query: Value '2017-00-00 00:00:00 'can not be represented as java. SQL. Timestamp
- Solution: add the zeroDateTimeBehavior parameter to the database connection string or the noDatetimeStringSync parameter jdbc: mysql: // host: port/xxx ?...
ZeroDateTimeBehavior: value exception, converToNull, and round
- Exception --- throw an exception: the result is java. SQL. SQLException: Value '2017-00-00 00:00:00 'can not be represented as java. SQL. Timestamp.
- ConverToNull: returns a null value.
- Round: 0001-01-01 00:00:00. 0 is returned.
NoDatetimeStringSync: If set to true, 0000-00-00 00:00:00 is returned.
Thank you for reading this article. I hope it will help you. Thank you for your support for this site!