spring jdbctemplate delete syntax -
please can point out mistake in following code of spring jdbc template. when click delete, record not getting deleted , there no errors showing.
public void delete(string id) { logger.debug("deleting existing person"); // prepare our sql statement using unnamed parameters style string query = "delete person id = ?"; // assign values parameters object[] person = new object[] {id}; // delete jdbctemplate.update(query, person); }
here example. pay attention:
integer id
public boolean delete(integer id){ string sql = "delete organization id = ?"; object[] args = new object[] {id}; return jdbctemplate.update(sql, args) == 1; }
Comments
Post a Comment