public static HashSet<Class> getClassRows() {
        Connection conn = ConnectionManager.getInstance().getConnection();
        
        String sql = "{call selectClassRows()}";

        try (PreparedStatement stmt = conn.prepareStatement(sql);
                ResultSet rs = stmt.executeQuery();) {

            HashSet<Class> hashSet = new HashSet<>();

            while (rs.next()) {
                Class classEntity = new Class();
                classEntity.setClassNo(rs.getString("classNo"));
                classEntity.setYear(rs.getInt("year"));
                classEntity.setClassName(rs.getString("className"));

                hashSet.add(classEntity);
            }
            return hashSet;

        } catch (SQLTransientConnectionException SQLtce) {
            return getClassRows();
        } catch (SQLTransientException SQLte) {
            return getClassRows();
        } catch (SQLException e) {
            System.err.println(e);
            return null;
        } finally {
            try {
                conn.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }