二、在mybatis中模糊查询可能出现的异常信息
1.There is no getter for property named 'user_name' in 'class java.lang.String'
严重: Servlet.service() for servlet UserServlet threw exception
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'user_name' in 'class java.lang.String'
### Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'user_name' in 'class java.lang.String'
..............
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'user_name' in 'class java.lang.String'
异常问题描述:在mybatis的模糊查询中,通过传递一个参数进行检索时,对参数进行判断,不能根据传递的参数的属性作为判断条件,而是"_parameter"。
2.java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
严重: Servlet.service() for servlet UserServlet threw exception
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
### The error may involve cn.spring.dao.UserMapperDao.selectByKey-Inline
### The error occurred while setting parameters
### Cause: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).