Announcement Announcement Module
Collapse
No announcement yet.
JdbcTemplate update help? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 "Update table SET column1=blah, column2=foo WHERE.."

    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 "?" 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.

  • #2
    You'd have to dynamically create your prepared statement on the fly based on the columns that were passed through using something like this:

    http://static.springsource.org/sprin...atementCreator)

    Comment

    Working...
    X