The recent use of mybatis found the Java.sql.SQLException:Zero date value prohibited exception, the online check for a reason. In fact, the MySQL database in the face of 0000-00-00 00:00:00 date processing, if not set corresponding countermeasures, will produce an exception.
So the solution is to set up the processing Zerodatetimebehavior in Jdbcurl to deal with, generally have the following several:
1.driver-url=jdbc:mysql://127.0.0.1/test?zerodatetimebehavior=Converttonull
Zero date will be converted to null
2.driver-url=jdbc:mysql://127.0.0.1/test?zerodatetimebehavior=Round
Zero date will be converted to 0001-01-0100:00:00.0, equivalent to one year
In general, the use of converttonull will be better, to convert the date to null, more in line with the meaning of zero date
MySQL is one of the most popular open-source databases in the world. As a key component of the open-source software bundle LAMP (Linux, Apache, MySQL, and Perl/PHP/Python), MySQL has been widely applied to different scenarios.
Learn more about ApsaraDB RDS for MySQL - A fully hosted online database service that supports MySQL 5.5, 5.6, 5.7, and 8.0.