![]() ![]() ![]() ![]() |
Contents |
In the Preparationslesson, you saw how to set up a Hashtable object, populate it with some properties, and then use it as a parameter to the InitialContext constructor
. Here is an example:
In fact, almost every example you have seen in this book has used a similar pattern. The data in the Hashtable is called environment properties, or simply environment. The use of the Hashtable as shown is but one way of specifying environment properties.Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial"); Context ctx = new InitialContext(env);This lesson describes in detail what exactly are environment properties, where they come from, and how they are used by the JNDI. This lesson also describes how to update environment properties and how to customize a service provider using properties.
![]() ![]() ![]() ![]() |
Contents |