Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 29th, 2003, 09:35 AM
flanagaj flanagaj is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 13 flanagaj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Utilising Paging of results

Hi,

I want to give my users the ability to page through the results rather than delivering all results to one web page. I was thinking what is the best way to do this. So far I have thought of

1. Use a scrollable resultset and store rs in session.
2. Hit the database to get the IDs and store these in the session and then hit the dbase each time the next or prev button is pressed (Thought this way might be slow)

Any ideas welcomed.


Thanks


Justin

Reply With Quote
  #2  
Old May 29th, 2003, 02:41 PM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 35 m 19 sec
Reputation Power: 111
I would suggest against putting a restultset in a session. A resultset keeps a connection open to the database and a session usually lasts 30 minutes. That is prohibitively long to keep one connection open to the database. You would see performance problems as soon as you deployd your app.

I would either read the whole resultset into some type of collection (that you can then put in the session) and read through it at your leisure later, or if you have a database that can handle it (like MySql) you can provide starting indexes and number of records to retrieve in the query. See the LIMIT keyword in the SELECT syntax
http://www.mysql.com/documentation/...nce.html#SELECT

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Utilising Paging of results


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT