Mybatis java.lang.IllegalArgumentException:uncategorized SQLException for SQL []; SQL state [NULL]

Source: Internet
Author: User

1, the database field of the original type is the date type, because of the data reason, the field is changed to a string type, resulting in MyBatis reported Java.lang.illegalargumentexception,

Because the database changes I don't know, so this question has been checked for a long time

2, the solution process

The first thought was SQL, but the MyBatis assembled statements were put into plsql without errors

Next locate the database replacement is not the same, the result found a field with the same name, the original database type is date, after the database is changed, the field type is string

After the execution of SQL, the returned data is inconsistent with the defined data type, resulting in an error

3. Solution

Modify the defined object's field type to string

4. Conclusion

After you have written your code, it is a good idea to keep the data consistent when you migrate it, or to check the impact on existing code after making changes.

Mybatis java.lang.IllegalArgumentException:uncategorized SQLException for SQL []; SQL state [NULL]

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.