@Override
    public Student getCourses(int userId) throws SQLException {
        List mainCourses = new ArrayList();
        List<Course> addCourses = new ArrayList<>();
        Connection connect = null;
        PreparedStatement statement = null;
        try {
            Class.forName(Params.bundle.getString("urlDriver"));
            connect = DriverManager.getConnection(Params.bundle.getString("urlDB"),
                    Params.bundle.getString("userDB"), Params.bundle.getString("passwordDB"));

            String getTeacherId = "select student.id from student " +
                    "where student.user_id = ?";

            statement = connect.prepareStatement(getTeacherId);
            statement.setInt(1, userId);

            ResultSet studentIdSet = statement.executeQuery();
            studentIdSet.next();

            int studentId = studentIdSet.getInt("student.id");

            String selectMarks = "select student.main_course_1_id,student.main_course_2_id, student.main_course_3_id, student.main_course_4_id," +
                    "student.add_course_1_id, student.add_course_2_id from student where student.id = ?";
            statement = connect.prepareStatement(selectMarks);
            statement.setInt(1, studentId);
            ResultSet resultMark = statement.executeQuery();
            while (resultMark.next()){
                int course_id = resultMark.getInt("student.main_course_1_id");
                mainCourses.add(new Mark(getCourseById(statement, connect, course_id), 0));
                course_id = resultMark.getInt("student.main_course_2_id");
                mainCourses.add(new Mark(getCourseById(statement, connect, course_id), 0));
                course_id = resultMark.getInt("student.main_course_3_id");
                mainCourses.add(new Mark(getCourseById(statement, connect, course_id), 0));
                course_id = resultMark.getInt("student.main_course_4_id");
                mainCourses.add(new Mark(getCourseById(statement, connect, course_id), 0));

                course_id = resultMark.getInt("student.add_course_1_id");
                addCourses.add(getCourseById(statement, connect, course_id));
                course_id = resultMark.getInt("student.add_course_2_id");
                addCourses.add(getCourseById(statement, connect, course_id));
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            if(connect != null)
                connect.close();
            if(statement != null)
                statement.close();
            Student student = new Student();
            student.setAdditionalCourseList(addCourses);
            student.setGeneralCourses(mainCourses);
            return student;
        }

    }