public static boolean closeConnectionGUI(Component owner) {
        if (isClosed()) return true; //Nothing to do conection already closed
        
        int response = JOptionPane.showConfirmDialog(owner,
                            "Do you want to save changes?",
                            "Save",
                            JOptionPane.YES_NO_CANCEL_OPTION,
                            JOptionPane.WARNING_MESSAGE);
        try {
            switch(response) {
                case JOptionPane.YES_OPTION: getConnection().commit();
                                             closeConnection();
                                             return true;
                case JOptionPane.NO_OPTION : getConnection().rollback();
                                             closeConnection();
                                             return true;
                case JOptionPane.CANCEL_OPTION :
                default: return false;
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        return false;
    }