public void testHandle2() throws Exception {
   String sql = "select employee_id, employee_name from emp4 where employee_id = 7369";
   Connection con = getConnection();
   PreparedStatement ps = con.prepareStatement(sql);
   final List<EmployeeDto3> ret = new ArrayList<EmployeeDto3>();
   ResultSetHandler handler =
       new FetchDtoMetaDataResultSetHandler(
           createDtoMetaData(EmployeeDto3.class),
           createRowCreator(),
           new FetchHandler<EmployeeDto3>() {
             public boolean execute(EmployeeDto3 bean) {
               ret.add(bean);
               return true;
             };
           });
   try {
     ResultSet rs = ps.executeQuery();
     try {
       handler.handle(rs);
     } finally {
       rs.close();
     }
   } finally {
     ps.close();
   }
   assertNotNull(ret);
   assertEquals(1, ret.size());
   EmployeeDto3 dto = (EmployeeDto3) ret.get(0);
   assertEquals(7369, dto.getEmployeeId());
   assertEquals("SMITH", dto.getEmployeeName());
 }
 public void testHandle() throws Exception {
   String sql =
       "select empno, ename, dname from emp, dept where empno = 7788 and emp.deptno = dept.deptno";
   Connection con = getConnection();
   PreparedStatement ps = con.prepareStatement(sql);
   final List<EmployeeDto> ret = new ArrayList<EmployeeDto>();
   ResultSetHandler handler =
       new FetchDtoMetaDataResultSetHandler(
           createDtoMetaData(EmployeeDto.class),
           createRowCreator(),
           new FetchHandler<EmployeeDto>() {
             public boolean execute(EmployeeDto bean) {
               ret.add(bean);
               return true;
             };
           });
   try {
     ResultSet rs = ps.executeQuery();
     try {
       handler.handle(rs);
     } finally {
       rs.close();
     }
   } finally {
     ps.close();
   }
   assertNotNull(ret);
   assertEquals(1, ret.size());
   EmployeeDto dto = (EmployeeDto) ret.get(0);
   assertEquals(7788, dto.getEmpno());
   assertEquals("SCOTT", dto.getEname());
   assertEquals("RESEARCH", dto.getDname());
 }
 /** @throws Exception */
 public void testHandle() throws Exception {
   ResultSetHandler handler = new BeanListResultSetHandler(Employee.class);
   String sql = "select * from emp";
   Connection con = getConnection();
   PreparedStatement ps = con.prepareStatement(sql);
   List ret = null;
   try {
     ResultSet rs = ps.executeQuery();
     try {
       ret = (List) handler.handle(rs);
     } finally {
       rs.close();
     }
   } finally {
     ps.close();
   }
   assertNotNull("1", ret);
   for (int i = 0; i < ret.size(); ++i) {
     Employee emp = (Employee) ret.get(i);
     System.out.println(emp.getEmpno() + "," + emp.getEname());
   }
 }