Creating an Directory Entry This example creates an entry in the directory. try { // Create attributes to be associated with the //new entry // case-ignore Attributes attrs = new BasicAttributes(true); Attribute objclass = new BasicAttribute( "objectclass"); objclass.add("top"); objclass.add("extensibleObject"); attrs.put(objclass); // Create the context Context entry = ctx.createSubcontext( "cn=Sample", attrs); } catch (NamingException e) { }