Java 在Spring CRUD示例中,编辑值未更新

Java 在Spring CRUD示例中,编辑值未更新,java,mysql,spring,Java,Mysql,Spring,这是我的代码。当我选中复选框并单击编辑按钮时,值被正确提取。但编辑后的值在mysql数据库和表中不会更新。我在这个示例中使用jdbc模板。位置字段是选择选项值 控制器获取复选框值并从数据库获取数据。之后,更新的值不会显示在表中 HomeController.java UsersDAO无法从formedit页面获取更新值 UsersDAO.java formedit.jsp 因为这是错误的: return jdbc.update("update customer set name = ?,sto

这是我的代码。当我选中复选框并单击编辑按钮时,值被正确提取。但编辑后的值在mysql数据库和表中不会更新。我在这个示例中使用jdbc模板。位置字段是选择选项值

控制器获取复选框值并从数据库获取数据。之后,更新的值不会显示在表中

HomeController.java UsersDAO无法从formedit页面获取更新值

UsersDAO.java formedit.jsp 因为这是错误的:

 return jdbc.update("update customer set name = ?,storage = ?,location = ?,address=? where id = ?",id,name,storage,location,address);

参数顺序不正确,找不到带值地址的id

你可以将它们添加到列表中,然后将列表转换为数组。是的,我得到了答案
public List<Users> getUpdateRecord(int updateValue){
    System.out.println("update value"+updateValue);
    String sql="select id,name,storage,location,address from customer where id="+updateValue;
    return jdbc.query(sql,new UsersMapper());
}

public int updateRecord(int id,String name,String storage,String location,String address){
    return jdbc.update("update customer set name = ?,storage = ?,location = ?,address=? where id = ?",id,name,storage,location,address);
<form role="form" action="saveUpdate" method="post" class="form-horizontal">
  <c:forEach var="row" items="${result}">
  <div class="row">
  <div class="col-md-6">
  <div class="form-group">
  <label class="control-label col-xs-4 text">Customer Name</label>
  <div class="col-xs-8">
  <input type="text" class="form-control" name="name" value=${row.name }>
  </div>
  </div>

<div class="form-group">
<label class="control-label col-xs-4 text">Storage Location*</label>
<div class="col-xs-8">
<input type="text" class="form-control" name="storage" value=${row.storage }>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-xs-4 text">Location</label>
<div class="col-xs-8">
<input type="text" class="form-control" name="location" value=${row.location }>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 text">Customer Address</label>
<div class="col-xs-8">
<textarea class="form-control" name="address">${row.address }</textarea>
</div>
</div>
</div>
<input type="submit" class="btn btn-success btn-md col-md-offset-6" value="Update">
</div>
</c:forEach>
</form>
}
 return jdbc.update("update customer set name = ?,storage = ?,location = ?,address=? where id = ?",id,name,storage,location,address);