Hi guys,
I've also been curious about how this is done for a long time. First time I tried to build such a thing I failed because I did not have my thinking cap on
. I needed it for my guestbook at
www.ernieboy.com. So I tried again two days ago with a new approach. In fact, I used a method which is similar to yours Anupreet where I store all the records in a session and then scroll through them.
This is a jsp that I used to put this thing together and it demonstrates the basics of how it works. You can download the source code from
here, it runs as is. Any constructive criticism of the code is welcome so that you can help me be a better developer.
My question. If I had 10000 records in that db, wouldn't this method be a drawback since everyone that asks for my guestbook will have a Vector with 10000 records in it? Doesn't this affect server memory? Of course, the other way to go is to use some sort of a scrollable result set as already mentioned but this also has overhead since we are hitting the databse for every N records we need. At least the data is not stale though like when using the vector in a session. So what is better guys?
[ October 23, 2004: Message edited by: ernest fakudze ]
[ October 23, 2004: Message edited by: ernest fakudze ]