Hi,
I'm not sure why you think navigation is 'fraught with difficulty' in
JDBC 2.0 with the advent of scrollable cursors. The problem is finding
drivers ( if you're not on an AS/400. )
As to retrieving everything in Vectors, Vectors are slow and clearing
them even more so. One may want to use Object[] or other Collections.
Retrieving ALL results first is slow. If the result set is large,
retrieving ALL results can cause page swapping or Out of Memory conditions,
so one needs to have a reliable feel for the size of potential returns,
especially in enterprise level apps. There is obviously no question that in
memory data is faster; whether it is feasible is another question.
Joe Sam Shirah
Autumn Software
-----Original Message-----
From: Andy Bailey <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Saturday, August 14, 1999 9:22 AM
Subject: Re: Regarding Session
>> Hi
>> I have a query regarding sessions
>>
>> Can I store a resultset object retrieved from a database as a session
>> object and then retrieve it back
>>
>> Thanks
>> JIgar
>>
>Hi,
>
>as Chris rightly says it depends on the Database. I wouldn't recommend
>storing the ResultSet in the
>session object anyway.
>
>A much better solution would be to process the entire result set and store
>each record in a class that
>mirrors the fields in them.
>
>This has manifold benefits.
>
>You can create Vector pages of these objects, making the delivery of pages
>of records much easier.
>
>You are free to navigate backwards and forwards through the pages,
something
>that is fraught with difficulty
>even with JDBC 2.
>
>You get the result set size for free thus freeing you from using count() or
>other methods for counting
>records.
>
>Database server traffic is minimised, limited to each new query to the
>server instead of multiple hits
>via sub queries and/or grabbing of records from the result set.
>
>I haven't looked into exactly how the session object actually deals with
the
>objects it contains. If the
>session object loads everything it has into memory when you get it then you
>will run the risk of
>blowing your heap. If, however, only those objects that you actually recall
>using getValue are brought
>into memory then there is no heap problem. Perhaps someone else can shed
>some light on the subject.
>
>I use this method of processing result set in any case. It works well for
>me. It was also recommended
>by someone who has much more experience in this field than I, George Reese
>author of a few books
>on JDBC and SQL.
>
>Hope this helps
>
>Andy Bailey
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html