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:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old August 9th, 2002, 12:58 PM
kulkarni_ash kulkarni_ash is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: NJ, USA
Posts: 0 kulkarni_ash User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question JSP Design question

Hi,
I have to develop a website, where in i have to show a table with data,
I want to show only 10 records per page, I got a taglib on URL for paging logic which works fine,
I have a bean which calls a store procedure, and this bean has page scope
so each time when i load the page, it calls the store proceudre , then this taglib get the resultset and load 10 records,
when the user clicks on next page link, again the page is loaded and all results extracted and the pages shows next 10.
so each time i change the page the store procedure is executed.
Is there a way i can run the store procedure only once and save the resultset and use it for next displays.
I think one way is to keep the resultset in session and before calling the storeprocedure, check in session , if there is resultset dont call or else call the store procedure.
Does anyone have a better way of doing it

Ashish

Reply With Quote
  #2  
Old August 10th, 2002, 01:28 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
Sounds like a fine way of doing it.

Reply With Quote
  #3  
Old August 12th, 2002, 02:05 PM
jnicholas jnicholas is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 5 jnicholas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
If you put the ResultSet in session it stays connected to the database. Result sets are populated as you ask for each row so it keeps the connection open. You can use a CachedRowSet or loop through the ResultSet and store all the data in a Javabean as a Collection like an ArrayList and put that where your pages use it.

Reply With Quote
  #4  
Old August 12th, 2002, 05:23 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
Yup, I just read that about resultsets. Better to make a databean to store the info.

I have never heard of a CachedRowSet. Where did you see this?

EDIT:
nm, I found it
http://www.javaworld.com/javaworld/...-cachedrow.html

Reply With Quote
  #5  
Old August 12th, 2002, 10:01 PM
kulkarni_ash kulkarni_ash is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: NJ, USA
Posts: 0 kulkarni_ash User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,
Thanx for the replies , right now i am using cahced rowset to store the data and use to load the jsp pages, and when ever the user reloads the page, reload the data...
about cached rowset u can get info at
URL
also has anyone developed any logic,if there are say 1 million records in database and need to be displayed 10 at a time.
also has anyone return a stateless bean ..i hope it may help in this condition...
Ashish

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > JSP Design question


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 6 hosted by Hostway