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.
Thanks in advance Diana
Raghav Mathur
Ranch Hand
Joined: Jan 12, 2001
Posts: 639
posted
0
hi i've written a mail to about your prob....check it please and do write to me if still ion prob
Raghav.
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
"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
james_deshpande
Greenhorn
Joined: Feb 13, 2001
Posts: 23
posted
0
Dear Bhidu(means friend), Connection conn=DriverManager.getConnection(.....) ((OracleConnection)conn).setDefaultRowPrefetch(30); this way u can fetch 30 rows each time u write rs.next(){ }