Hi all,
How would you implement paging of large result sets for a web client?
The client is invoking (querying) a servlet invoking a stateless session bean that performs the database query. The result set is potentially very large and I want the client to be able to fetch parts of the result set (keep a cursor open). Any ideas?
The problem is how to keep the connection open on the server. A stateful session bean can be passivated and I would loose the cursor, right?
A somewhat related problem: Streaming of the result set all the way from the database to the client...
-
web client paging large result set (8 messages)
- Posted by: Marcus Eriksson
- Posted on: February 23 2004 16:44 EST
Threaded Messages (8)
- web client paging large result set by j h on February 23 2004 17:24 EST
- web client paging large result set by Marcus Eriksson on February 24 2004 16:33 EST
- Paging through large result sets by Sean Sullivan on February 23 2004 18:58 EST
- Paging through large result sets by Marcus Eriksson on February 24 2004 16:37 EST
- Paging through large result sets by Sean Sullivan on June 19 2004 21:56 EDT
- ValueList does teh paging and sorting in the database... by Matthew Wilson on July 26 2004 15:25 EDT
- scrollable result set by Suma GS on March 02 2004 07:57 EST
- the first article is comprehensive and excellent by Balaji Ragu on July 15 2004 02:47 EDT
-
web client paging large result set[ Go to top ]
- Posted by: j h
- Posted on: February 23 2004 17:24 EST
- in response to Marcus Eriksson
can you pull the full result set into the servlet, put it into the user's session context, then implement paging in the servlet, leaving the stateless session bean alone? -
web client paging large result set[ Go to top ]
- Posted by: Marcus Eriksson
- Posted on: February 24 2004 16:33 EST
- in response to j h
No that would obviously not work for really large result sets. However, I'm thinking about selecting only rowid/keys that way. Perhaps even keeping the result set on the client... -
Paging through large result sets[ Go to top ]
- Posted by: Sean Sullivan
- Posted on: February 23 2004 18:58 EST
- in response to Marcus Eriksson
"Value List Handler" pattern:
http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html
"DataListHandler" pattern
http://www.theserverside.com/resources/article.jsp?l=DataListHandler
http://www.theserverside.com/home/thread.jsp?thread_id=13939
article: ResultSet pagination using DB2, JDBC, and JSPs
http://www7b.boulder.ibm.com/dmdd/library/techarticle/0307balani/0307balani.html
DisplayTag (an open source JSP tag library)
The DisplayTag library provides tags for displaying large data sets.
The tag library supports: column display, sorting, paging,
cropping, grouping, exporting, and decoration.
http://displaytag.sourceforge.net/
Live demo @ http://www.displaytag.org/index.jsp -
Paging through large result sets[ Go to top ]
- Posted by: Marcus Eriksson
- Posted on: February 24 2004 16:37 EST
- in response to Sean Sullivan
Thanks Sean!
Sadly, none of the proposed patterns are perfect. To be a perfect solution we would need to keep the connection open. There are no real alternatives.
One of your proposed solutions may be good enought, though. I'll have to think about what our needs really are... -
Paging through large result sets[ Go to top ]
- Posted by: Sean Sullivan
- Posted on: June 19 2004 21:56 EDT
- in response to Sean Sullivan
article: "Paging in J2EE: Manage Large Result Sets Efficiently"
http://www.devx.com/Java/Article/21383 -
ValueList does teh paging and sorting in the database...[ Go to top ]
- Posted by: Matthew Wilson
- Posted on: July 26 2004 15:25 EDT
- in response to Sean Sullivan
Take a look at: http://valuelist.sourceforge.net -
scrollable result set[ Go to top ]
- Posted by: Suma GS
- Posted on: March 02 2004 07:57 EST
- in response to Marcus Eriksson
May be scrollable resultset would help here... -
the first article is comprehensive and excellent[ Go to top ]
- Posted by: Balaji Ragu
- Posted on: July 15 2004 02:47 EDT
- in response to Marcus Eriksson
Paging in J2EE: Manage Large Result Sets Efficiently
http://www.devx.com/Java/Article/21383/1954?pf=true
jGuru: Paging with Scrollable ResultSets
http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/exercises/SRS/