cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin J Walters <>
Subject Re: hierarchical resultsets & xml
Date Wed, 23 Aug 2000 00:33:36 GMT

s> It appears that the root of the problem is that JDBC doesn't do hierarchical
s> recordsets (I don't think it's in jdbc 2.0 either - does anyone know this
s> for sure?).  So I can't directly construct a query that brings back
s> department 1
s>         Employee 1
s>         Employee 2
s> department 2
s>         Employee 3
s>         Employee 4
s> etc...(that wouldn't use standard sql anyway, it'd be oracle-specific)

I do a similar thing with multiple resultsets. I wasn't too sure how i 
should do this and ended up with a 

1) stored procedure which generates an ordered set of result sets
   and tags each one with an additional column to indicate what it is
2) a cocoon page which converts this into xml via a mess of java.

The stored proc is a bit inefficient because it's tailored to the
cocoon page, in particular the order binds the two together. In your
case i would return 4 resultsets.

A more natural (and efficient) approach would be to return all the
stuff to the client in multple resultsets (2 in your case) and then
have the client sort through the bits it wanted, but i didn't want to
put the load on the web server (in this case), and i didn't want the
java in my cocoon page to have build a local copy of the data - i just
output getString() stuff. I also have an advantage since this app is
small scale, no updates, and only returns 5-10 resultsets with less
than 100 rows total.

The downside of not having a copy of the data in the 'servlet' is that 
i can't cache the sybase queries which might be a nice addition...



Kevin J Walters                      Morgan Stanley Dean Witter,  750 Seventh Avenue
Tel: 212 762 1752                    New York
Fax: 212 762 0174                    NY 10019

View raw message