Thanks for your reply Christopher.

Here are my thoughts:

* Execute a new query each time. Have a sort clause in the query, and also
have a greater than clause on some field. Each time extract the first 100
results. ( sort by id and id > x. the current value of x gets embedded in
the hyperlink "Next")

Advantages are that it is clean, and doesn't require much memory on the
server side.
Disadvantages are that it needs to reexecute the query each time. Also
sorting on a text column would slow down the system.

* Save the result set each time, along with the session id. With each page
scroll, get the result set and start using it.

Advantages are that it would be fast, and also would not require too much of
extra memory.
Disadvantages are that the result set would keep a connection to the
database. Now, questions arise on as to when do you release this connection,
and many hits can make the servlet run out of connections.

* Extract the whole result and save it in memory along with the session id.

Advantages are that it would easily release the database connection.
Disadvantages are that it would require a whole lot more memory, and also
when do you dump the memory thus grabbed. Also, the first page would be slow
because it would get all the matching results out of the database.


James, I also think that using "The Pager Tag Library" would also have this
disadvantage of having to get all the matching results out of the database,
so I'm not sure if its the right solution.


-James
Thanks,
Jayant.


-----Original Message-----
From: Christopher K. St. John [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 26, 2000 12:27 PM
To: [EMAIL PROTECTED]
Subject: Re: Implementing Page Scrolling


"Shekhar, Jayant" wrote:
>
> What is the best way to implement Page Scrolling. I mean, if 1000 items
need
> to be displayed, I want to display 100 items per page with a link to the
> next page. I have thought out many possibilities, but are unable to decide
> upon the proper one.
>

 The proper answer depends on many things.

 It might help to post some of the details of your problem, the
possible solutions you've come up with so far, and the advantages
and disadvantages you see for each of them. That would make it
easier to give you feedback.


-cks

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to