日期:2014-05-20 浏览次数:20818 次
while(rs.next()){ [color=#FF0000]bean = new DeptInf();[/color] bean.setDepartmentid(rs.getString("dpid")); bean.setDepartmentname(rs.getString("dpnm")); bean.setSuperdepartmentid(rs.getString("supid")); list.add(bean); }
------解决方案--------------------
把你的bean new到循环里边去 你这样永远是一个对象
像这样
while(rs.next()){
bean = new DeptInf();
bean.setDepartmentid(rs.getString("dpid"));
bean.setDepartmentname(rs.getString("dpnm"));
bean.setSuperdepartmentid(rs.getString("supid"));
list.add(bean);
}