The Artima Developer Community
Sponsored Link

Java Answers Forum
JavaServlets and sessions. Need a little help!!

1 reply on 1 page. Most recent reply: Apr 14, 2002 5:27 PM by rajnish

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Master

Posts: 7
Nickname: plut
Registered: Mar, 2002

JavaServlets and sessions. Need a little help!! Posted: Apr 14, 2002 11:06 AM
Reply to this message Reply
Advertisement
This is the problem:

I fetch some data from a database and this data is
put inside a ResultSet object. I want to show 10 rows
from the dbms at first. (Print it out as html!) Then if the user wants to see the next 10 elements??

I need to preserve the ResultSet from the last client request! Can I store the ResultSet object inside a httpsession?? Or is there another approach to this??
Please help me with some examples if possible..


Thank you in advance :)


rajnish

Posts: 1
Nickname: rajnish
Registered: Apr, 2002

Re: JavaServlets and sessions. Need a little help!! Posted: Apr 14, 2002 5:27 PM
Reply to this message Reply
First fetch all teh records from database into vector and then store this vector in httpsession ...Write a servlet which fetches ten records at a time on the basis of index passed .if index is 2 it shoiuld fetch 11 to 20 records from vector and display to user..

passedvalue=new Integer(request.getParameter("anyoneulike")).intValue();
for (i=(passedvalue*10-9);i<=passedvalue*10;i++)
{

//use vector.elementAt(i) method

//write code here to fetch from session and then put //the values in response
}

for fetching first ten records

Flat View: This topic has 1 reply on 1 page
Topic: how can i do the word processor's page operations in my java word processor Previous Topic   Next Topic Topic: Program flow - throw/catch

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use