Using LDAP with JNDI

Of the directory services supported by JDK 1.3, LDAP is by far the most flexible. You can store a wide variety of items in an LDAP directory and you can get LDAP servers for a wide variety of operating systems. A good place to get a free LDAP server for Linux and Unix is http://www.openldap.org. They are also working on a version for Windows NT.

LDAP stores data in a hierarchical (tree) structure. You refer to an entry in the tree by listing the names of the nodes in the tree, starting at the one you want, working backward to the top of the tree. LDAP paths look confusing at first, but after you understand the notation, it's not so bad. Figure 18.1 shows an example LDAP tree.

Figure 18.1. LDAP stores its entries in a tree ...

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.