|
|
JdbcTemplate update help?
I'm fairly new at using this framework so any help would be appreciated.
I want to use the jdbctemplate.update() to do an sql Update statement. The Update statement would look something like quot;Update table SET column1=blah, column2=foo WHERE..quot;
My question is, is there a way I could pass in a variable length argument list for the columns I want to set into the arguments of the jdbctemplate.update() method? I understand you could pass in an array of arguments but those arguments are just the place holders for the quot;?quot; in your sql statement? So for a variable length argument list, I need to pass in both the column names and what I want them to set as.
Any help would be appreciated. Thank you.
You'd have to dynamically create your prepared statement on the fly based on the columns that were passed through using something like this:
sprin...atementCreator) |
|