// mybatis²âÊÔ @Test public void testSelect() { EmpDao empDao = new EmpDao(); List<EmpEntity> list = empDao.findAll(); for (EmpEntity empEntity : list) { System.out.println(empEntity.getEmpName()); } }
// spring²âÊÔ @Test public void testSelect2() { ApplicationContext ac = new ClassPathXmlApplicationContext(new String[] {"spring.xml"}); EmpDao empDao = (EmpDao) ac.getBean("empDaoID"); /*List<EmpEntity> list=empDao.findAll(); for (EmpEntity empEntity : list) { System.out.println(empEntity.getEmpName()); }*/ List<EmpEntity> list = empDao.findByPage(0, 3); for (EmpEntity empEntity : list) { System.out.println(empEntity.getEmpName()); } }