String re = "inCart";
String sre = "Sold";
resultSetP = statement.executeQuery("select * from shoppingcart where proStatus='" + re + "' and customerID='" + this.customerID + "'");
while (resultSet.next()) {
int ed = statement.executeUpdate("update shoppingcart set proStatus='" + sre + "' where proStatus='" + re + "' and customerID='" + this.customerID + "'");
}
resultSetS = statement.executeQuery("select * from shoppingcart where serStatus='" + re + "' and customerID='" + this.customerID + "'");
while (resultSet.next()) {
int efd = statement.executeUpdate("update shoppingcart set serStatus='" + sre + "' where serStatus='" + re + "' and customerID='" + this.customerID + "'");
}
答案 0 :(得分:0)
在您的代码中,您在循环条件 resultSet.next()中写入它可能应该是 resultSetS.next()或 resultSetP.next()< / em>的