1.       student.xml添加如下代码:
<select id=”selectStudentByName” parameterClass=”String” resultClass=”Student”>
        select sid,sname,major,birth,score
        from Student
        where sname like ‘%sname%’
</select>

 

2.       IStudentDAOImpl.java增加如下代码:
public List<Student> queryStudentByName(String name){
        List<Student> studentList = null;

 

        try{
               // selectStudentByName是查询语句的id
       studentList = sqlMapClient.queryForList
                             (“selectStudentByName”,name);
}catch(SQLException e){
       e.printStackTrace();
}
return studentList;
}