Parsing a Compound Name This example parses a compound name using a parser from an LDAP service in which components are arranged from right to left, delimited by the comma character (","). try { NameParser parser = ctx.getNameParser(""); Name dn = parser.parse( "cn=John, ou=People, o=JNDITutorial"); // ou=People dn.remove(1); // cn=John,o=JNDITutorial,c=us dn.add(0, "c=us"); // cn=fs,cn=John,o=JNDITutorial,c=us dn.add("cn=fs"); } catch (NamingException e) { }