This sample code is used to update database values using spring framework.

Java Code:
import javax.sql.DataSource;
import org.springframework.jdbc.core.JdbcTemplate;

public class UpdateExample {

private JdbcTemplate jt;
private DataSource dataSource;

public void setPerson(int id, String name) {
jt = new JdbcTemplate(dataSource);
jt.update("update person set name = ? where id = ?", 
    new Object[] {name, new Integer(id)});
}

public void setDataSource(DataSource dataSource) {
this.dataSource = dataSource;
}
}