O'Reilly logo

LDAP Programming with Java™ by Tony Dahbura, Rob Weltman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deleting an Entry

The data in an LDAP directory must be kept up-to-date and valid. Eventually an entry will need to be removed. Deleting an entire entry from the directory is a simple process:

      String theDN = "uid=bjensen, ou=People, o=airius.com";
      try {
          ld.delete(theDN);
      } catch ( LDAPException e ) {
      }

The LDAPConnection.delete method takes a single argument: the DN of the record to be deleted. All that is needed to delete a leaf node is the DN and the proper authorization to delete the record. An ou or o entry may be deleted using the code just given, provided there are no entries underneath in the tree. A node that contains entries underneath it is a branch node, and it cannot be deleted using this method. This constraint is a limitation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required