code: public static Context getContext( String jdniInitialContextFactoryName , String providerURL , Hashtable<String,Object> extraEnv ) throws NamingException
      {
      	Hashtable<String,Object> env = new Hashtable<>();
          env.put(Context.INITIAL_CONTEXT_FACTORY, jdniInitialContextFactoryName);
          env.put(Context.PROVIDER_URL, providerURL);
          if (extraEnv != null)
              env.putAll(extraEnv);
          return createJndiContext(env);
      }
docs: Create a JNDI context for the current provider
  @param jdniInitialContextFactoryName
  @param providerURL
  @param extraEnv
  @return a JNDI context
  @throws NamingException