public int dUpdateReservation(Reservation res) throws UnauthorizedUserException, BadConnectionException {
        PreparedStatement pStmnt = null;
        
        // close a reservation and leave a comment
        try {
            pStmnt = con.prepareStatement(qs.update_res_d);
            pStmnt.setString(1, res.getComment());
            pStmnt.setInt(2, res.getReservationNumber());
            pStmnt.executeQuery();            
        }
        catch(SQLException sqlE) {
            if(sqlE.getErrorCode() == 1142)
                throw(new UnauthorizedUserException("AccessDenied"));
            else 
                throw(new BadConnectionException("BadConnection")); 
        }
        finally {
             try {
                 if(pStmnt != null) pStmnt.close();
            } catch (Exception ex) {
                
            }
        }
                     
        // update the customer reservation count and memberID (if needed)
        try {
            pStmnt = con.prepareStatement(qs.update_res_count);
            pStmnt.setInt(1, res.getCustomerID());
        }
        catch(SQLException sqlE) {
            if(sqlE.getErrorCode() == 1142)
                throw(new UnauthorizedUserException("AccessDenied"));
            else 
                throw(new BadConnectionException("BadConnection")); 
        }
        finally {
             try {
                 if(pStmnt != null) pStmnt.close();
            } catch (Exception ex) {
                
            }
        }
        return 1;
    }