ParseCompound

try {
    NameParser parser = ctx.getNameParser("");
    Name dn = parser.parse("cn=John, ou=People, o=JNDITutorial");

    dn.remove(1);                 // ou=People
    dn.add(0, "c=us");            // cn=John,o=JNDITutorial,c=us
    dn.add("cn=fs");              // cn=fs,cn=John,o=JNDITutorial,c=us
} catch (NamingException e) {
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.