Originally posted by amit malhotra:
Hello Manjunath,
thanx a lot for the reply, But as far is EJB is concerned I am totally blank,Is this the way normal search engines like Google do it,please reply back
Hi,
The way I did this is:
When you get the results from the JDBC or any other call, store the results in a vector and a current index variable in the session (the index variable is to indicate the last row that is being displayed). If you are currently going forwar in the resultset, this will be the last row displayed among the 20 rows. If you are going backwards, this will be the first row among the 20 rows.
Give the users choice to get the previous 20 results or the nex 20 results. The URL for forward or reverse should have a flag that indicates to the JSP what to do (reverse or forward).
Based on which link they click, use the vector in the session, current index variable in the session and just decrement or increment from the index variable and show those elements from the vector. Also make sure you update the index variable to indicate the current position of the access.
Hope this helps.
Bala.