| Author |
paging in servlets
|
Anthony Karta
Ranch Hand
Joined: Aug 09, 2004
Posts: 342
|
|
I'm in the middle of implementing Catalog Page - following Marty Hall book -well the sample codes only use static Array. My catalog data is in table. is it good idea to load all records in catalog object (ArrayList)? they are around 100 at the moment and growing. is there another/better approach? could someone show me how to implement paging (say 20 item per page) in Servlets or should handle by JSP? how? is there any online sample/resources? thanks all tony
|
SCJP 5
|
 |
Rahul Juneja
Ranch Hand
Joined: Aug 03, 2002
Posts: 425
|
|
Tony, There is a datastructure called Cached Rowset in Java which can be used to get the data in a tabular form in one call to the database and then u can read the data records 10 rows at a time from that. This is also called disconnected rowset as it doesn't fires a connection every time next set of records are fetched. I think this can be the suitable option for you if your data doesn't get updated every time. Thanks, Rahul Juneja
|
Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
|
 |
Anthony Karta
Ranch Hand
Joined: Aug 09, 2004
Posts: 342
|
|
Thanks Rahul! I didn't realize Java has Cached Rowset. But how to implement it... do I need to create Cached Rowset for every session? or put it in init() method in Servlet or import the data class in JSP page? if Rowset is disconnected then how I can check the stock of items? do you have some sample codes or somewhere on internet? thanks again tony
|
 |
 |
|
|
subject: paging in servlets
|
|
|