String sql="update books set stock=stock-"+count+"where bid="+bid; 这行又问题 ,改成String sql="update books set stock=stock-"+count+" where bid="+bid;
String sql="update books set stock=stock-"+count+"where bid="+bid;sql语句里面涉及到拼接字符串的时候要用单引号引起来。 String sql="update books set stock=‘stock-"+count+" ’ where bid=‘ "+bid+“,”;
这行又问题 ,改成String sql="update books set stock=stock-"+count+" where bid="+bid;
String sql="update books set stock=‘stock-"+count+" ’ where bid=‘ "+bid+“,”;