Java 9: when learning Mybatis, the following error occurs: Parameter & #39; name & #39; not found. Available parameters are [1, 0, param1, param2], nameisntavailable

Source: Internet
Author: User

Java 9: when learning Mybatis, the following error occurs: Parameter 'name' not found. Available parameters are [1, 0, param1, param2], nameisntavailable

Error --> Parameter 'name' not found. Available parameters are [1, 0, param1, param2]

Baidu found this article to complete the modification http://blog.csdn.net/w86440044/article/details/29363067

The operation class I previously wrote is the same as that of the blogger. It is like this:

1 // login · query 2 @ Select ("select * from t_users where uname =#{ name} and pswd =#{ pswd}") 3 public Users findByNP (String name, string pswd );

The above error is displayed during the test. After the modification is made according to the blogger method:

1 // login · query 2 @ Select ("select * from t_users where uname = # {0} and pswd = # {1}") 3 public Users findByNP (String name, string pswd );

Run the test program.

Result: The name cannot be used for matching. Is there any other reason?

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.