package a; import java.io.IOException; import java.io.Reader; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import com.ibatis.sqlmap.client.SqlMapClient; public class StudentDao { private static SqlMapClient sqlMapClient=null; static { try { Reader reader=com.ibatis.common.resources.Resources.getResourceAsReader("a/SqlMapConfig.xml"); sqlMapClient=com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(reader); reader.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void addStudent(Student student) { } public void deleteStudentById(int id) { } public void updateStudentById(Student student) { } public List<Student> getStudents() { List<Student> list=new ArrayList<Student>(); try { list=sqlMapClient.queryForList("selectAllStudents"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return list; } public Student getStudent(String uname) { Student student=new Student(); return null; } public static void main(String[] args) { StudentDao dao =new StudentDao(); List<Student> list=dao.getStudents(); for (Student student : list) { System.out.println(student); } } }


飞翔的面包片 LV13
2021年7月13日
ztuotuoz123 LV2
2020年9月24日
才貌双泉 LV5
2020年4月2日
李攀登 LV8
2018年12月4日
blueairabc LV2
2018年12月4日
wsm666666 LV5
2018年7月13日
devilshome LV4
2018年5月15日
感动常在 LV12
2017年10月27日
qwerty12345 LV2
2017年10月22日
minifan LV6
2017年9月7日