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 ) ; }
Create a JNDI context for the current provider