• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Adding objects to session

Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm currently querying four tables based on what the user enters in the query, and getting all columns from them, and storing the resultset in a vector object. First, I'm displaying few columns from the resultset and a unique column, which is a href, in an intermediate display page. Next, when the user clickes on the unique column, he's taken to a details page which shows that particular row's information. I'm adding this vector object to the session in the intermediate display page, so that I can retrive it based on unique column on which the user clicks, in the details page. My doubt is, I'm adding all the rows in the resultset to the session, so that I can retrieve it on the next page depending on what unique row the user wants. But adding such objects, especially when they can be huge depending on the query, doesn't seem to be right.
I thought of adding only the row which the user wants to see,to the session object in the jsp page, but unless they click on the unique column and goto the details page, I won't know which row it is. As I'm displaying all rows in the resultset in the intermediate display page, I'm adding all these rows into the vector, then into the session.
Can anyone suggest a better way of doing all this ? Ant suggestions would be helpful.
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are several ways you can approach the problem. Here are two ideas.
- Show only x results per page. Then you only need to store the details for x rows
- Don't store any details in the session. When the user clicks a link for details, perform another db query to get the details
Your mind is under my control .... your will is now mine .... read this tiny ad
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic