Share

VPP - Velocity Preprocessor

Tracker: Feature Requests

5 add resultSet to context - ID: 1079952
Last Update: Comment added ( markus_printz )

I've implemented a 'resultSet' type for vpp:context,
which adds an ArrayList of HashMaps to the velocity
context. This way I can process a db result in a
template with vpp. The syntax looks like:

...
<context>
<resultSet key="dbResult" driver="${db.driver}"
url="${db.url}" userid="${db.user}"
password="${db.password}" query="select col1 from tab1"/>
</context>
...


The template can then look like this:

...
#foreach ($record in $dbResult)
<tag>NAME="$record.COL1";</tag>
#end
...

If anyone is interested, I could contribute the code.
It's not much, just one new class VPPResultSet.java and
a new method (addConfiguredResultSet) in VPPContext.
But the result is very useful (at least for me).


Nobody/Anonymous ( nobody ) - 2004-12-06 12:13

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 2 )




Date: 2004-12-06 12:29
Sender: markus_printz

Logged In: YES
user_id=1172757

sorry, I wrote this request without having an account. Here
it is...


Date: 2004-12-06 12:28
Sender: markus_printz

Logged In: YES
user_id=1172757

sorry, I wrote this request without having an account. Here
it is...


Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.