JNDI

Now you're ready to talk to LDAP from Java. To do this, you use the Java Naming and Directory Interface (JNDI). JNDI can be used for a lot more than just interfacing to LDAP. For example, you can use JNDI to talk to DNS. But for now, our discussion will be restricted to JNDI as it pertains to LDAP.

JNDI itself doesn't know anything about LDAP. Instead, it provides a general interface that lets a programmer talk to a number of different resources (such as NIS, LDAP, or DNS) using the same API. What all these have in common is the notion that a name can be looked up in some kind of directory to return information about that name. For example, in DNS, a name maps to an IP address. In LDAP, a name (represented as a DN or an RDN) maps to an LDAP ...

Get MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL 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.