tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mike jackson" <>
Subject RE: [off topic] - passing a ResultSet from a servlet to a JSP
Date Tue, 29 Apr 2003 19:17:23 GMT
If I were you (and I'm not) I'd use XML.  Build a utility that'll take a
result set and create and xml data stream.  Then you just pass it to an
xslt engine (xalan) and you have a wonderful html file, or PDF/PS/PCL
file (with FOP).  Or you could go further and have a wonderful SVG file.
For that matter you could also have another wonderful xml file.  Or just
about any other type of file.

Personally this is what I do, but I have the advantage of having a
pretty nice Oracle tool which does this for me.  If you're not on oracle
you don't have this option and you'll have to roll your own.  The oracle
XDK is the toolset that I'm using.

mike jackson

> -----Original Message-----
> From: Shapira, Yoav []
> Sent: Tuesday, April 29, 2003 10:19 AM
> To: Tomcat Users List
> Subject: RE: [off topic] - passing a ResultSet from a servlet to a JSP
> Howdy,
> >4) Puts the ResultSet into the session
> >5) Forwards to a JSP page
> <snip>
> >soon as the dB connection is closed. So how can it be working? And
> >importantly, what's a better way of accomplishing this?
> Don't send ResultSets around.  Instead, have the servlets loop through
> the result set and create whatever object you need to hold the result
> set's contents.  Then close and discard the result set (and statement,
> and connection to the db, etc, all in a finally {} block or whatever
> ensure they execute blah blah blah).
> Instead of passing the resultset, pass this object.  You have more
> control over its implementation, whether it's serializable, etc.  As
> noticed, the ResultSet interface is subject to different
> in different JDBC drivers (even drivers from the same vendor for the
> same DB on different platforms).  This makes the ResultSet object a
> candidate for a session attribute, because variable platform-dependent
> behavior tends to occur.
> Yoav Shapira
> Millennium ChemInformatics
> This e-mail, including any attachments, is a confidential business
> communication, and may contain information that is confidential,
> proprietary and/or privileged.  This e-mail is intended only for the
> individual(s) to whom it is addressed, and may not be saved, copied,
> printed, disclosed or used by anyone else.  If you are not the(an)
> intended recipient, please immediately delete this e-mail from your
> computer system and notify the sender.  Thank you.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message