public static HashSet<Class> getClassesWithCourseNo(String courseNo) {
        Connection conn = ConnectionManager.getInstance().getConnection();
        
        String sql = "{call selectClassRowsWithCourseNo(?)}";

        ResultSet rs = null;

        try (PreparedStatement stmt = conn.prepareStatement(sql);) {
            stmt.setString(1, courseNo);
            rs = stmt.executeQuery();

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

            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 getClassesWithCourseNo(courseNo);
        } catch (SQLTransientException SQLte) {
            return getClassesWithCourseNo(courseNo);
        } catch (SQLException e) {
            System.err.println(e);
            return null;
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
                conn.close();
            } catch (SQLException e) {
                System.err.println(e);
            }
        }
    }