Retrieving selected attribute when doing basic search

In this post under Java LDAP, I will show with example how to retrieve specific attributes when doing basic search. For our example we will use the below ldap hierarchy. Now lets see the main code which actually does the search. Main class 1 package package11; 2 3 import javax.naming.Context; 4 import javax.naming.NamingEnumeration; 5 import…… Continue reading Retrieving selected attribute when doing basic search

Basic Search in LDAP

In this post under Java LDAP, I will show with example how to perform a basic search for entries in LDAP. I have below ldap tree. In this ldap tree under development department with dn “ou=dev”, I have three developers “user1”, “user2”, and “user3”. “user1” has “description” attribute with value “Softwareengineer 2” whereas “user2” and…… Continue reading Basic Search in LDAP

InitialDirContext lookup method

In this post under Java LDAP, I will show how to lookup for an entry in LDAP directory tree using ldap distinguished name. Below is the complete main class for your reference Main class 1 package package2; 2 3 import java.util.Hashtable; 4 5 import javax.naming.Context; 6 import javax.naming.NamingException; 7 import javax.naming.directory.DirContext; 8 import javax.naming.directory.InitialDirContext; 9…… Continue reading InitialDirContext lookup method