• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Memory Utilization When Using JDBC

 
Rajeev Iyer
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!!
I have a SQL resultset returning about more than 2000 rows. This requires to displayed onto the web client (JSP).
I display 500 records per page and to display the next set of records, I store the resultset object in the session. I read the next set of records from the session, since I want to save a trip to the DB. Then I display the results on the web client.
Is this a good technique as far as memory utilization of the server is concerned or is there any other technique?
Thanks in advance...
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you should search this forum as well as the JSP and Servlet forums for 'Resultset paging'.
The most important point is that there is no single solution. The solution depends on the problem you are trying to solve, and whether you solve it using disconnected ResultSets, Http Sessions, cached results or via specific SQL will depend on the restrictions of your problem.
Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you decide to maintain paging via the Database queries, have a look at this thread. It has the queries you'll need for most popular databases.
Just remember the queries will become database specific...
Jamie Robertson recommends this document:
http://www.theserverside.com/resources/articles/DataListHandler/DataListHandler.pdf
This thread is quite good too.
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic