java2db

Select more than one entry from LDAP directory using java JNDI



Some times it is require to display all users from a specific directory . To do this , we must Select more than one entry from LDAP directory at a time.

Basic requirements for authentication :

Select more than one entry from LDAP IP address and port of the LDAP server.

Select more than one entry from LDAP LDAP Admin DN and password.

Select more than one entry from LDAP

LDAP-Directory

 

Process to Select more than one entry from LDAP :

First connect to the LDAP server as an admin .

Create the user DN to select .

……..Example: If you want to select all entries from the  ou=alzebra directory,then the DN will be

……..ou=alzebra ,dc=sciencedep,dc=college .

  Call the search method .

Example to Select more than one entry from LDAP:

Execution Result:

 

From the above example ,

  ldaps://10.160.2.11:1500  is the LDAP server url (IP and Port).

  Connection type is “simple” ,that means  it will take the plain text as password for authentication.

  cn=LDAP Administrator,dc=college,dc=org,dc=in  is the Administrator DN .

ou=alzebra,dc=mathsdep,dc=college,dc=org,dc=in  is the DN to search.

The search filter is null . So it will return all entries from the search directory .

Add new entry to LDAP SearchControls.SUBTREE_SCOPE  Bounds the search to the subtree rooted at the given object

……or naming context.

Note : The search  returns null, if the directory not contains any entry.

 




Related Posts :
SELECT statement to get records from the table in sql
Delete entry from OpenLdap with java JNDI
Search or select all entries from OpenLdap specific dir with java JNDI
Search or select entry from OpenLdap with java JNDI
Update or edit entry in OpenLdap with java JNDI
Add new entry in OpenLdap using java JNDI
Connect to the OpenLdap with java JNDI
Select an entry from LDAP using java JNDI
   [will not be published]



^ <