Previous | Next | Trail Map | The Basics | Contents

Directory Operations

You can use the JNDI to perform directory operations, including the following: This lesson describes each of these operations. Before using any of them, you should read the section on the use of attribute names that apply to all of these operations.


The examples in this lesson use the LDAP service provider. They assume that you have set up a sample namespace using the content described in the Preparations (in the Basics trail) lesson. If you use another service provider or choose to use another part of the LDAP namespace, then the behavior will differ from what is shown here.

The initial context used in these examples is initialized using the following environment properties.

// Set up the environment for creating the initial context
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial");
DirContext ctx = new InitialDirContext(env);

Previous | Next | Trail Map | The Basics | Contents