mybatis

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,否则会报错:没有将所有参数绑定(绑定指将?替换的过程)

新生的小心情
原文地址:https://www.cnblogs.com/jianmianruxin/p/7472753.html