Extracted SQL State class ' S1 ' from value ' S1009 '

Source: Internet
Author: User

Found not to check all the fields can be queried, the last field to try, found that there is a problem in passwd_time this field, and then see this time is not valid time, changed to a valid time. RELATED links: MySQL time ' 0000-00-00 ' exception resolution in the Spring+mybatis project, query MySQL database encountered a problem: Java.sql.SQLException:Value ' 0000-00-00 ' can not Be represented as java.sql.Date analysis look at the reason, should be mybatis the Date Type field to String type, encountered date Type field ' 0000-00-00 ', cannot convert, So throw the exception to check the information on the Internet: MySQL database date, timestamp and other time types default to ' 0000-00-00 ' solution 1: Database connection URL Add parameter zerodatetimebehavior= Converttonull or round, can be said that the default ' 0000-00-00 ' conversion to other values; I also encountered a problem before: in DB2, the default value of the event type is ' 1900-00-00 ', but it has been an error in MySQL, The default value of the time type that was found to be MySQL by query must start with ' 1970-00-00 '. In addition, when the MySQL time type definition is not indicated as NULL, the default is not NULL, resulting in a default value of ' 0000-00-00 '. So there are two solutions to the problem: Solution 2: Give the default value when defining the time type, for example, date not null default ' 1970-00-00 '; solution 3: Define the time type defaults to NULL, for example, date null; Note: The official website gives the default value of the timestamp type to "1970-01-01 00:00:01 ' UTC to ' 2038-01-19 03:14:07 ' UTC in China due to the time zone problem for 1970-01-01 08:00:01 to 2038-01-19 11:14:07

Extracted SQL State class ' S1 ' from value ' S1009 '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.