Directory Operations

JNDI has directory-specific extensions for performing directory operations as opposed to the simple name-value operations in most naming services. The DirContext interface and InitialDirContext classes provide additional methods for dealing with directories. The directory-specific classes are all contained within the javax.naming.directory package.

If you need to perform directory operations, create an InitialDirContext instead of an InitialContext. For example

DirContext dirCtx = new InitialDirContext();

All the same rules apply to InitialDirContext as far as the property names for choosing an initial context factory.

The Attribute interface and the BasicAttribute class represent an attribute of an object stored in a directory. ...

Get Special Edition Using Java™ 2 Enterprise Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.