Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: JSP & Oracle (opinions follow)
"Niall Litchfield" <n-litchfield_at_audit-commission.gov.uk> schrieb im
Newsbeitrag news:96u6r6$8rb$1_at_soap.pipex.net...
> This looks like a good solution. However In my experience too many
> developers use scrollable results sets when they don't need them. This is
> (or can be) a huge waste of resources. Like Sybrand I don't know a whole
lot
> about Java and in particular JSP, but I'm not completely unfamiliar with
it.
> If all you are doing with your result set is displaying it in a web page,
> all you should ever need is a read-only forward recordset. In my
experience
> scrolling, especially scrolling updateable recordsets are way too
expensive
> in terms of client and server resources and are almost always used if the
> developer possibly can.
I fully agree!
Looking at Douglas' example, it would be better not to write alle the
HTML-Code directly to the page but into a temporary String. With this you
can simply .next() through the Resultset and write the information when you
have it, not when you need it.
Example:
String output = "<table>";
int MaxActualite = 0;
while (rsActualite.next())
{
output += "<tr><td>"+ rsActualite.getString(1)+"</td><tr>";
MaxActualite = rsActualite.getRow();
}
// ah it's over - now we can add the number of rows to the beginning
output = MaxActualite + "<br>" + output;
file://out.println(MaxActualite + "<br>"); // is this right?
Matz Received on Tue Feb 20 2001 - 11:01:59 CST