Caching Result Set ?

folksI have a search page which returns a result set and the results are put in the session to be able to access when user clicks on the page numbers(pagination) in the results pane. Is there any way we can store or cache this and access instead of fetching it off the
[298 byte] By [kmathewma] at [2007-11-27 8:47:34]
# 1

You can store the data as a multi dimensional array in javascript on the rendered jsp page as a javascript function. It exists on the client side (browser) and you can use an onClick event on the page's button to call up various parts of the array and display it to the user. That way, your user doesnt have to submit the page back to the servlet to pagenate to the next page. The data shows up immidiately instead. You'll have to read up on javascript to learn how to do this. (Also I assume you are storing the resultant data in some type of array and not the raw resultSet).

However, if so much data is returned to the user he needs pagenation, I suggest you add filter textfields to allow him to limit what data is returned so pagenation is not needed. Pagenation implies there is too much data for the user to effectively use at once (no one likes scrolling down a list of 200 items). For instance, instead of displaying all names in a list, add a filter so the user can search for all last names that begain with an A, or B, etc through Z. Then, when displayed to the user, show the list sorted by your filter criteria (lastName). If there is still too much data in the list, I suggest putting up a vertical scrollbar rather than pagenation.

George123a at 2007-7-12 20:52:41 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...