Hello,
I need to compile templates based on database ResultSet rows.
I have application properties, something like
database.statement=SELECT name,surname FROM user
template.name=sometemplate.vm
sometemplate.vm:
<body>Hello $db.firstname $db.surname !</body>
Java meta-code:
conn = DriverManager.getConnection(...)
result = statement.executeQuery(<statement from properties above>);
while (result.next()) {
context=SomeMagicClassThatWillMergeResultToContext.mergeRow(result);
template= template = Velocity.getTemplate(<template from properties>);
template.merge(context, writer);
}
My question: is there any simple solutions to map DB ResultSet into
context or HashMap (without involving complex J2EE
stuff/Spring/Hibernate)?
What is the best practice anyway?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]