This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi everybody, I know that my question is not a new here, but I would really appreciate if you help me. We are using MVC model 2 (servlet/java beans/jsp). All database operations I put inside of servlet, and I know that the max number of rows in a result set can be 500, so we are retrieving the whole result set, and need to display 30 records per page.
But I don't use Vector, and I am not sure what should be done in servlet/bean/jsp in order to display first 30 rec, then next 30 rec, and so on...
If you can send me some code, that will explain this, I would really appreciate.
"diana b", The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements. Thanks.
If you're not using a Vector (hope you meant ArrayList?), then what are you using, and why? And where exactly are your problems, is this a general Java question, or a JSP question, or what? Anyway, the OO way would be to write a java.util.ListIterator or iterator-like object for your result set and bind that in your session (request.getSession().setAttribute("myIterator", iterator) -- or, better still, make it part of the state you maintain in a session-bound JavaBean that encapsulate all your state and logic). The jsps (or, better still, controller servlet) can then manipulate that iterator in response to user requests (eg /myapplication/myjsp.jsp?action=nextSet). - Peter