MySQL Date data type exception reason 0000-00

Source: Internet
Author: User

1. Database fields:

DEFAULT NULL ' Date of first license card ',

2. Exception information

org.springframework.dao.TransientDataAccessResourceException: # # # Error querying database. Cause:java.sql.SQLException:Value' 0000-00-00 'can not be represented as java.sql.timestamp### the error could exist in COM/autoyol/mapper/membermapper.xml### The error may involve com.autoyol.mapper.membermapper.getmembaseinfobytoken### the error occurred whileHandling results### Sql:select Reg_no as Memno, Nick_name as nickname, Real_name as Realname , first_name as FirstNam E, gender, mobile, base_dir as Userbasepath, Portrait_path as Portrait, res_times as Ownerrestimes, res_total_time as     Ownerrestotaltime, Res_avg_time as Ownerresavgtime, buy_times as Renttimes, buy_total_res_time as RenterResTotalTime, Buy_res_avg_time as Renterresavgtime, email, email_auth as Emailauth, Id_card_auth, Id_card_back_auth, Dri_lic_aut    H, Day_req_count, Day_cancel_req_count, Rent_flag, renter_rating as renterrating, dri_lic_first_time as DriLicFirstTime From member WHERE token=?# # Cause:java.sql.SQLException:Value' 0000-00-00 'can not be represented as java.sql.Timestamp; SQL []; Value' 0000-00-00 ' can not is represented as Java.sql.Timestamp; Nested exception is Java.sql.SQLException:Value ' 0000-00-00 ' can not be represented as Java.sql.Timestamp

3. Analysis

3.1 When the client modifies the data to NULL, the system will default to ' 0000-00 ', so when the query, the mapping will be error, unable to understand the date time

3.2 If you want to remove the date data, you need to fill in null, so you can.

3.2 Directly select the date or fill in the date, 2015-01-22

MySQL Date data type exception reason 0000-00

Related Article

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.