[Date Prev][Date Next] [Chronological] [Thread] [Top]

Java + LDAP



Hi all,

I have defined in my schema a multivalued attribute groupId. I have the
following Problem:

groupId: 2 
groupId: 3
groupId: 4 
groupId: 5 
groupId: 6 
 
This is only one attribute which holds many values . But when I want to use
the modify method from JNDI like this 

<code-snip>
      Hashtable env = new Hashtable();

      env = setEnviroment(aHypLdapModifyTrans.getLdapUsername(),
aHypLdapModifyTrans.getLdapPassword());
      DirContext ctx = new InitialDirContext(env);

      ModificationItem[] mods = new ModificationItem[1];
      mods[0] = new
ModificationItem(aHypLdapModifyTrans.getModificationType(),
      new BasicAttribute(aHypLdapModifyTrans.getAttributeName(),new
String(aHypLdapModifyTrans.getAttributeValue())));

      ctx.modifyAttributes(aHypLdapModifyTrans.getDistinguishedName(),
mods);

      ctx.close();
<code-snip>

I overwrite my existing multivalued Attribute . How can I solve them that I
can only change one values in the multivalued Attribute.  
I have seen in many tools it is possible to change one value without to
delete the mutlivalued Attribute . 

Thanks for any help in advance

Regards
Ferruh