@Override
    public Exam get(String examId) {
        Exam.Builder examBuilder = new Exam.Builder();

        try (Connection con = getConnection();
             CallableStatement callableStatement = con.prepareCall(querySelectExamById)) {
            callableStatement.setNString(1, examId);

            try (ResultSet resultSet = callableStatement.executeQuery()) {

                if (resultSet.next()) {
                    examBuilder = examBuilder.id(resultSet.getString(aliasExamId))
                            .name(resultSet.getString(aliasExamName))
                            .subject(new Subject.Builder().name(resultSet.getString(aliasSubjectName)).build());

                    LinkedHashMap<String, Question.Builder> questionBuilders = new LinkedHashMap<>();

                    do {
                        String questionId = resultSet.getString(aliasQuestionId);
                        Question.Builder questionBuilder = questionBuilders.get(questionId);
                        if (questionBuilder == null) {
                            String questionText = resultSet.getString(aliasQuestionText);
                            questionBuilder = new Question.Builder().id(questionId).text(questionText);
                            questionBuilders.put(questionId, questionBuilder);
                        }
                        questionBuilder.addAnswer(
                                new Answer.Builder()
                                        .id(resultSet.getString(aliasAnswerId))
                                        .text(resultSet.getString(aliasAnswerText))
                                        .isCorrect(Integer.parseInt(resultSet.getString(aliasAnswerIsCorrect)) == 1)
                                        .build());
                    } while (resultSet.next());

                    for (Question.Builder builder : questionBuilders.values()) {
                        examBuilder.addQuestion(builder.build());
                    }
                }
            }

        } catch (SQLException e) {
            logger.error("Failed to retrieve exam with examId {}", examId);
            throw new SphinxSQLException(e);
        }
        return examBuilder.build();
    }