我试图在特定数量的查询后获得结果,即
String sql="Select from mytable where sell_id =
'"+purchase_id+"'";
java.sql.Statement stmt=conn.createStatement();
java.sql.ResultSet res=stmt.executeQuery(sql);
while(res > 4){ //this line is where i still couldn't figured out
String quantity = res.getString("quantity");
String item = res.getString("item_name");
String price = res.getString("price");
}
但它显示错误“二元运算符'>'的错误操作数类型”
| quantity | item | price |
| 20 | soda | 5$ |
| 10 | noodle | 7$ |
| 5 | water | 3$ |
| 15 | gum | 4$ |
| 14 | tissue | 2$ |
| 2 | snack | 6$ |
结果应该是这样的
| 14 | tissue | 2$ |
| 2 | snack | 6$ |
任何建议都会被接受
江户川乱折腾
胡子哥哥
相关分类