Can anybody suggest me on the logic how to build a jsp in which I need to display 10 records from the resutlset on each. At the bottom of the page I have to display href values page 1 of 7 , 2 of 7 and so on. When the user clicks on any of them I have to show the data. I not able to think of a logic how can I achieve that. Thanks Neha
One thing to be careful of when storing results (presumably in the session) of a query is that you have to make sure your database isn't too large. What if a search returned 50,000 rows? You don't want to save a 50,000 row vector into a session. All you need is a handful of users to nail you with some searches like that and you are looking at some big memory consumption on your app server.
That's what EJB is for, but that's a whole different discussion.
Hi Neha, I have implemented the same thing. You can go for CachedRowsets than going for ResultSets. Going thru CachedRowset is easier and it provides many methods which are very useful. C if itt works on your side too... atleast it gave me good and fast results. -Sid
Siddarth, I tried to find where in the Java API is this CachedRowSet class ? Can you please clear this out ?
<b><i>KaReEm</i><br /><ul type="square"><li>SCJP-Free Range Web Developer <br /></ul></b>
Joined: Aug 06, 2001
How i would usually go about something like this and i've done it before is to pass boundary parameters to the page the will show the results, so by default these parameters would be 0, 20 let's say if u want to show 20 records. and then if i will provide a next link at the end of the 20 rows i pass the next set of boundary parameters 20, 40 and so on it really depends on how your database manages it , for mySQL you give a limit [start_row],[number_of_rows] format for oracle you give a condition something like where rownum < 20 something like that.