Home > Database > Mysql Tutorial > body text

Mysql series (14) datetime query exception

黄舟
Release: 2017-01-22 17:06:20
Original
1733 people have browsed it

Mysql series (fourteen) datetime query exception

  • Exception: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp (2011-05-25 11:38:40)

  • #Description: A non-empty Datetime type field with no default value, the program reports the following error when querying: Value ' 0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

  • Solution: Add zeroDateTimeBehavior parameter or noDatetimeStringSync parameter to the database connection string jdbc:mysql:/ /host:port/xxx?...

  • ##zeroDateTimeBehavior: value exception, convertToNull, round


  • exception---Exception thrown: Result java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql .Timestamp.

  • converToNull: Returns null value

  • round: Returns 0001-01-01 00:00:00.0



  • ##noDatetimeStringSync: Set to true, return 0000-00-00 00:00: 00
  • The above is the content of the datetime query exception in the Mysql series (fourteenth). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template