Dump the result set into a List of objects ?
843836May 7 2005 — edited May 9 2005How to do this:
A) Dump the result set into a List of objects that hold the data from the results, and store the List in the session. Then when you reload/view next/previous page, you can take a sublist from the list...
int start = page * itemsPerPage;
int end = start + itemsPerPage;
List sublist = mylist.sublist(start, end);
B) If the database supports LIMIT (and most do), then you can get the database to return the page of data only. So just get a connection and make a new query for the page.
int start = page * itemsPerPage;
ResultSet rs = stmt.executeQuery("select * from myTable limit " + start + ", " + itemsPerPage);
B) no beans or tags just jsp <%=jspcode %>
C) My goal: 5 records per page and navigation Previous���| 1 - 2 - 3 - 4 - 5 |���Next
Mail to or reply post: ckhan83@hotmail.com