jsp实现mysql分页查询
写一个带int参数的查询方法实现分页查询; public Collection pagequery(int size){ Collection coll = new ArrayList(); String sql = "SELECT * From links ORDER BY id desc LIMIT "+size+","+15+"";//每页要显示的条数 ResultSet rs = conn.executeQuery(sql); try { while(rs.next()){ LinksBean bean = new LinksBean(); bean.setId(Integer.valueOf(rs.getString(1))); bean.setTitle(rs.getString(2)); bean.setUrl(rs.getString(3)); coll.add(bean); } } catch (SQLException e) {}finally{conn.close();} return coll; }