class AuthScopeRdbmsDao extends AuthScopeDao {

    @Override
    public AuthScope read(String scopeName) throws AuthServerException {
        Set<String> userGroups = new HashSet<>();
        String scopeId = null;
        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet resultSet = null;
        try {
            connection = getConnection();
            statement = connection.prepareStatement(RdbmsConstants.PS_SELECT_AUTH_SCOPE);
            statement.setString(1, scopeName);
            resultSet = statement.executeQuery();
            while (resultSet.next()) {
                if (Objects.isNull(scopeId)) {
                    scopeId = resultSet.getString(1);
                }
                String userGroup = resultSet.getString(2);
                if (Objects.nonNull(userGroup)) {
                    userGroups.add(userGroup);
                }
            }
        } catch (SQLException e) {
            throw new AuthServerException("Error occurred while retrieving scope for name : " + scopeName, e);
        } finally {
            close(connection, statement, resultSet);
        }

        if (Objects.nonNull(scopeId)) {
            return new AuthScope(scopeName, userGroups);
        }
        return null;
    }

    public  AuthScopeRdbmsDao(DataSource dataSource);

}