You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Campbell, Justin" <jc...@profilesys.com> on 2003/02/26 01:15:06 UTC

RE: [OT] Scrollable ResultSets, was: RE: new to the list, new to velocity...

"Depends on how its created; one-way ResultSets are the default but you can
create a scrollable one during the statement creation. Then you can scroll
all over, forwards and backwards, go to in indexed row number, etc."

Just a warning on this note from Dave: We converted a number of areas in our
production UI to use scrollable result sets -- big mistake! Maybe we just
had too high of volume, or maybe we made an error in coding but we found
them to be performance *nightmares*. Just a friendly note. :)

Best of luck.

- Justin

-----Original Message-----
From: Dave Newton [mailto:dave@solaraccess.com]
Sent: Tuesday, February 25, 2003 7:11 PM
To: Velocity Users List
Subject: [OT] Scrollable ResultSets, was: RE: new to the list, new to
velocity...


On Tue, 2003-02-25 at 19:04, Tim Colson wrote:
> IIRC, ResultSets can only be iterated over once in one direction which
> also can trip you up...but don't quote me, I may be hallucinating. ;-)

Depends on how its created; one-way ResultSets are the default but you
can create a scrollable one during the statement creation. Then you can
scroll all over, forwards and backwards, go to in indexed row number,
etc.

> Personally, I tend to create an ArrayList of HashMaps. Each map contains
> one row of the resultset (plus any additional info that is handy) to
> give the template.

I ain't gonna tell you your business ;) But using the JavaBean paradigm
allows easier reuse of these type of DB-related objects, say in struts,
JSTL, or anything else like that.

> #foreach ($item in $list_of_results)
>   $item.username = $item.realname #if ($item.goober) is a GOOBER! #end
> #end

This syntax would still be used, as JavaBeans have get/set methods for 
all properties, and would allow more universal usage.

Just my $.02 :)

Dave



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

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