env.put("java.naming.ldap.deleteRDN", "true"); // default is 'true'
/* Create the initial context */
DirContext ctx = new InitialDirContext(env);
try
{
ctx.rename("uid=user.0,ou=People,dc=example,dc=com",
"uid=,ou=People,dc=example,dc=com");
}
finally
{
/* Close the context when it's done */