mysql数据库在servlet中无法更新数据,总是显示更新失败

mysql数据库在servlet中无法更新数据,总是显示更新失败
**
Servlet
int amount;
Shopcar shopcar=new Shopcar();//model对象
amount=Integer.parseInt(request.getParameter("amount"));
//封装数据
shopcar.setAmount(amount);
//调用DAL,将数据添加到数据库
ShopcarDal dal=new ShopcarDal();
int count=dal.update(shopcar);
response.getWriter().print(count);
if(count>0)
response.sendRedirect(request.getContextPath()+ "/shopcar/shopcar");
else{
response.getWriter().print("数据更新失败");
}
jsp

商品号码:
商品名称:
商品价格:
购买数量:
购买账号:

运行结果总是显示数据更新失败

检查一下id 有没有传递哈