String sql = "update FirstTest set quan=? where name=?";
PreparedStatement ps = DBconnect.connect(sql);
try {
ps.setString(1,quan);
ps.setString(2,name);
ps.executeUpdate();
ps.executeUpdate();不能有参数sql,否则会报错:没有将所有参数绑定(绑定指将?替换的过程)
String sql = "update FirstTest set quan=? where name=?";
PreparedStatement ps = DBconnect.connect(sql);
try {
ps.setString(1,quan);
ps.setString(2,name);
ps.executeUpdate();
ps.executeUpdate();不能有参数sql,否则会报错:没有将所有参数绑定(绑定指将?替换的过程)