edit OrderDetailDao.java
This commit is contained in:
@@ -14,7 +14,6 @@ public class OrderDetailDao {
|
|||||||
|
|
||||||
public void save(OrderDetail detail) {
|
public void save(OrderDetail detail) {
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// Insert order detail
|
// Insert order detail
|
||||||
|
|
||||||
String sql = "INSERT INTO order_detail (order_id, menu_item_id, quantity, price) VALUES(?, ?, ?, ?)";
|
String sql = "INSERT INTO order_detail (order_id, menu_item_id, quantity, price) VALUES(?, ?, ?, ?)";
|
||||||
@@ -27,7 +26,7 @@ public class OrderDetailDao {
|
|||||||
preparedStatement.setInt(3, detail.getQuantity());
|
preparedStatement.setInt(3, detail.getQuantity());
|
||||||
preparedStatement.setDouble(4, detail.getPrice());
|
preparedStatement.setDouble(4, detail.getPrice());
|
||||||
|
|
||||||
preparedStatement.executeQuery();
|
preparedStatement.executeUpdate();
|
||||||
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user