为什么这样做不可以更新数据库呢?
try{
// create a prepared SQL statement
PreparedStatement updateacc;
String strSQL="UPDATE usraccount SET usermoney=?,ioflag=?,ftype=?,userbak=? where ID=?";
updateacc = con.prepareStatement(strSQL);
updateacc.setInt(1, money);
updateacc.setInt(2, ioflag);
updateacc.setInt(3, ftype);
updateacc.setString(4, bak);
updateacc.setString(5, id);
updateacc.executeUpdate();
}
其中,变量money,ioflag,ftype,bak,id是传递过来的
这个执行不报错,可是也不更新数据库,为什么?
谢谢。