Friday, December 25, 2009

JNDI Environment Properties

JNDI Environment Properties

JNDI provides place to specify various configuration details. There are different types of environment properties and defined in four clauses.

Standard JNDI environment properties
- defined by JNDI and common in all the service providers
  • java.naming.provider.url - URL, where the service provider deployed
  • java.naming.factory.initial - Initial Context implemented Class
  • java.naming.dns.url - URL, DNS host and domain names to use for the "jndi" URL context implementation
  • java.naming.factory.object
  • java.naming.factory.state
  • java.naming.factory.control
  • java.naming.factory.url.pkgs
Service-Specific Environment Properties
Common across all the service providers. Properties have the prefix java.naming.service. . For instance, java.naming.ldap.
Feature-Specific Environment Properties
Common across all the service providers for particular feature. Properties have the prefix java.naming.feature. . For instance, java.naming.sasl.
  • - username
  • - password (if keystore configured then key will be placed here instead of password)
Provider-Specific Environment Properties
Specific to service provider. For instance, LDAP trace property com.sun.jndi.ldap.trace.ber, GSS-API and kerberos properties

Some useful links Tutorial,TechnotessSecurity/Permission in client

Sample code to get context from LDAP

Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "ldap://localhost:7009/o=Oracle");

Context ctx = new InitialContext(env);



Post a Comment

Recent Posts

Unix Commands | List all My Posts


This blog intended to share the knowledge and contribute to JAVA Community such a way that by providing samples and pointing right documents/webpages. We try to give our knowledege level best and no guarantee can be claimed on truth. Copyright and Terms of Policy refer


Twitter Delicious Facebook Digg Stumbleupon Favorites More