I have an app that goes into a db via jdbc to grab a list of objects and then a servlet presents them in the form of a table.
The app shows the search results in pages....the first 25 results, then click next, 26-50 and so on. Currently, every time the user clicks the link for the next page, a new search is generated returning the entire result set. I realize this is a terrible way to do it. My current plan is to send a page num to the function that calls the sql statement and adjust it to get the results I want...but I was wondering, since this is a ubiquitous scenario, what is the best practice for this?
Also, currently the app gets a list of objects and pulls all the data for those objects whether they are used or not. In terms of scalable db searching code, what is the best practice for this? any good books re: java -> db you can recommend?