Here is an example using JNDI (included with Java 1.3 and above and available for download with older versions of Java). I've thrown in some comments that walk through what it does a bit. This program does a simple LDAP search for the root entry in the directory. It doesn't print anything fancy, but shows the general process of searching and retrieving results.
(edited by Cindy to format code) [ March 21, 2003: Message edited by: Cindy Glass ]