private DataSource lookupDatasource(JDBCIdentitySource config) {
        DataSource ds;
        try {
            InitialContext ctx = new InitialContext();
            ds = lookupDS(ctx, config.getDatasourcePath());
            if (ds == null) {
                ds = lookupDS(ctx, "java:comp/env/" + config.getDatasourcePath()); //$NON-NLS-1$
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        if (ds == null) {
            throw new RuntimeException("Datasource not found: " + config.getDatasourcePath()); //$NON-NLS-1$
        }
        return ds;
    }
Lookup the datasource from JNDI.
@param config
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/auth/JDBCIdentityValidator.java