"Error Note" MyBatis SQLException: Invalid column type: 1111

Source: Internet
Author: User

Problem Description:

Org.springframework.jdbc.UncategorizedSQLException:Error setting null for parameter #1 with jdbctype other. Try setting a different jdbctype for this parameter or a different jdbctypefornull the configuration property. Cause:java.sql.SQLException: Invalid column type: 1111

Problem Analysis:

This problem occurs because when we write SQL in an XML file, we do not specify a parameter type, and when we pass a value of NULL type, the program cannot automatically match according to the type of the entry parameter, only match to the other, if this parameter is required, it will run out of error because of type inconsistency.

Workaround:

Add type, such as Jdbctype=varchar, jdbctype=numeric ..., modify the entry code: #{param,jdbctype= specific type}, not #{param}

Suggestions:

It is best to display the specified parameter types and develop a good coding habit to avoid unnecessary anomalies.

"Error Note" MyBatis SQLException: Invalid column type: 1111

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.