As a newbie to Servlet programming, I think I may not have gotten something right here: I understand the concept of Java Beans and little ORM helper classes like org.apache.commons.dbutils.DbUtils
. I can convert a ResultSet
into an instance of my JavaBean-object with a ResultSetHandler
and a BeanHandler
. But isn't there any convenient way to do it the other way round, other than hardcoding the SQL string? Something like
QueryRunner run = new QueryRunner(datasource);
int result = run.update("UPDATE " + tableName + " SET " + [and now some Handler sets all the columns from the JavaBean]);
At least, I didn't find anything like that! Or did I get it wrong? Help appreciated.