tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mike jackson" <mjack...@cdi-hq.com>
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.

--mikej
-=------
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
> 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
more
> >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
to
> 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
you
> noticed, the ResultSet interface is subject to different
implementations
> in different JDBC drivers (even drivers from the same vendor for the
> same DB on different platforms).  This makes the ResultSet object a
bad
> 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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message