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?