Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JDBC equivelant to ADO Disconnected recordset

69 views
Skip to first unread message

runstein

unread,
Jun 13, 2002, 10:48:37 AM6/13/02
to
I'm somewhat new to Java and am coming from a M$ background, primarily
coding in VB. So, I'm starting to convert some of my ADO code to JDBC and
I'm wondering how to do a "disconnected" recordset in Java. The idea is
that I want to create a connection, make a call to retrieve a ResultSet,
then drop the connection while maintaining the ResultSet.

Any thoughts on how to accomplish this in Java would be appreciated.

Thanks


AV

unread,
Jun 13, 2002, 11:32:04 AM6/13/02
to
Please, visit:
http://www.javaworld.com/javaworld/jw-02-2001/jw-0202-cachedrow.html
http://developer.java.sun.com/developer/earlyAccess/crs
Sun's implementation has 100 records limit (to preserve memory).
Works OK.

There is similar implementation from Oracle
(search for ocrs12.zip in otn.oracle.com).
[I did not tested it yet]

Another approach would be transferring every record from ResultSet into
separate Java object and store such objects into Collection
(Vector, ArrayList). This approach is better from overall
architectural point of view but more coding required.

AlexV.


"runstein" <runs...@biotronik.com> wrote in message
news:ughat2k...@corp.supernews.com...

runstein

unread,
Jun 13, 2002, 12:16:27 PM6/13/02
to
Thanks Alex.

With placing the records into objects notion, and putting those in a Vector
or Array, would I create an object that has attributes matching each field
of the ResultSet? For a more dynamic approach, could I stuff each record
into an Array (in case there are native datatypes) and then stuff all the
Arrays into another Array or Vector? It seems I'd need to track what types
are stored within the record Arrays so that I can cast them when I need to
read the values. Again, I'm fairly new to how Java handles this stuff, so
if I'm missing a "gotcha" that's going to bite me in the rear later, please
let me know.

Thanks again


"AV" <avek_...@videotron.ca> wrote in message
news:0V2O8.3215$Mf2....@weber.videotron.net...

AV

unread,
Jun 13, 2002, 12:24:46 PM6/13/02
to
First of all, CashedRowSet is much more easier
for ASP >> JSP conversion.

Transferring ResultSet into array or Arrays is possible but
a bit awkward : too many various get/set/put/add.

Better approach here can be:
-- preliminary code-generation
(www.javaskyline.com look for OR mappers)
-- dynamic ResultSet metedata interrogation
(search web for Scott Amber articles)
-- JDO (something like www.jdocentral.com )

AlexV.

"runstein" <runs...@biotronik.com> wrote in message

news:ughg1v6...@corp.supernews.com...

0 new messages