日期:2014-05-17 浏览次数:20633 次
public ArrayList<Serch> list() throws SQLException { ArrayList<Serch> L=new ArrayList(); ResultSet rs=null; String sql="select * from book"; DB sqle=new DB(); rs= sqle.db(sql); while(rs.next()) { Serch s=new Serch(); s.setBid(rs.getString(1)); s.setBname(rs.getString(2)); s.setNumber(rs.getInt(5)-rs.getInt(6)); L.add(s); int a= L.size(); System.out.println(a); } System.out.println("测试链表长度:"+L.size()); return L; } } JSP显示: 用<s:iterator >标签, 经测试没问题....