Novell is now a part of Micro Focus

Using NJCL/JNDI, how can I delete one value...

Articles and Tips: qna

01 Jan 2003


Q.

Using NJCL/JNDI, how can I delete one value from a multivalue attribute? For example, how can I delete just one group from the "Group Membership" attribute?

A.

Just ensure you pass an attribute containing a value as well as the attribute name to the remove operation. For example:

Attribute groupMembership  = new
BasicAttribute("groupMembership", "some value you
wish to delete');
	
Attributes attsToRemove = new BasicAttributes();
	
attsToRemove.put(groupMembership);
	
dirContext.modifyAttributes(someObjectName, 
	
DirContext.REMOVE_ATTRIBUTE, attsToRemove);

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates