hi all,

I think there is 3 way to solution turn page problem,
1.  Every time on turning page, execute a query search on database, just get out the 
10 record your needed to display, display them and close the Connection. This way is 
simply, and is suitable to a large number of record in database, and it have a 
excellence, not need to worry about session timeout.

2.  Store a Vector in bean(scope is session), put all recordset value in Vector at the 
bean instance time , on turning page time , just get the value from the bean object 
and display them. This is suitable to just have few hundred record in database.

3.  Three way is Like Narayanan said below, Store the RecordSet in bean object(scope 
is session) , I am not sure about the efficiency of ths way, I have read some 
technical article mentioned about not to store big object such as RecordSet, 
Connection in session.

Sorry for my poor English .
Best Rgards,
Steven Zhao



----- Original Message -----
From: "Narayanan, Hariharan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 9:01 PM
Subject: Re: Caching the records


> Best way is to create a bean class which will execute the query and get the
> record set. Store the bean object in a session and then get the records from
> the object with the starting and end count. JDBC 2 does not provide any such
> facility. When you store the record set in a session object u need not call
> the database every time.
>
> Narayanan
>
>                 -----Original Message-----
>                 From:   Shuja Nawaz [mailto:[EMAIL PROTECTED]]
>                 Sent:   Monday, January 10, 2000 6:13 PM
>                 To:     [EMAIL PROTECTED]
>                 Subject:        Caching the records
>
>                 Hi.
>
>                 I want to display the records by parts. Like we have 90
> records returned by
>                 the query.
>                 10 records are displayed at a time. When the user clicks
> next link then next
>                 10 records
>                 are displayed and so on.
>                 Please suggest me how to cache the records so that I don't
> have to
>                 re-execute the query
>                 when the user clicks for next 10 records.
>                 Does JDBC 2 provides any such facility?
>
>                 Thanks in anticipation.
>
>                 Regards.
>
>                 From:
>                   Shuwaz.
>
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to