@Override
  synchronized  public void addOrderDetail(final OrderDetail orderDetail) {
                 Connection conn = null;
        PreparedStatement stmt = null;
       
        try {
            conn = dataSource.getConnection();
            stmt = conn.prepareStatement("INSERT INTO ORDERDETAIL(ORDER_ID,BOOK_ID,ORDERDETAIL_AMOUNT) VALUES(?,?,?)");
            stmt.setInt(1, orderDetail.getOrder_ID());
            stmt.setInt(2, orderDetail.getBook_ID());
            stmt.setInt(3, orderDetail.getOrderDetail_Amount());
            stmt.executeUpdate();
        } catch (SQLException ex1) {
           throw new RuntimeException(ex1);
        } finally {
              if (stmt != null) {
                try {
                    stmt.close();
                } catch (SQLException ex1) {
                    Logger.getLogger(BookDAO.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException ex1) {
                    Logger.getLogger(BookDAO.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }
        }
    }