javax.naming


1. Retrieve a Context object and display its environment

import javax.naming.*;
import javax.naming.ldap.*;

public class GetContext {
    public static void main(String[] args) {
        try {
            // Create an initial context
            Context ctx = new InitialContext();

            // Get the environment from the Context
            Hashtable<?, ?> env = ctx.getEnvironment();

            // Print the environment
            for (Enumeration<?> e = env.keys(); e.hasMoreElements();) {
                Object key = e.nextElement();
                Object value = env.get(key);
                System.out.println(key + ": " + value);
            }
        } catch (NamingException e) {
            e.printStackTrace();
        }
    }
}

2. Lookup a single object

3. Lookup multiple objects

4. Create an object

5. Modify an object

6. Rename an object

7. Delete an object

8. List objects in a context

9. Search for objects

10. Bind an object to a context

11. Unbind an object from a context

12. Rebind an object in a context

13. Lookup a reference