Posted By:
MURTUZA_PATRAWALA
Posted On:
Friday, July 20, 2001 05:00 AM
Why does case 1 give no attributes enven when the obj. does showup in lookup ? Thanx. CASE1. attrs1.put("description","It is my baseDN(sort of)"); dirContext.rebind("ou=newMurtuza",null,attrs1); Object ob=dirContext.lookup("ou=newMurtuza"); System.out.println("named obj is "+ob); Attributes gotAttrs=dirContext.getAttributes("ou=newMurtuza"); System.out.println("Attributes of gotAttrs= "+gotAttrs); OUTPUT IS: named obj is com.sun.jndi.ldap.LdapCtx@56a499 Attributes of gotAttrs= No attributes
More>>
Why does case 1 give no attributes enven when the obj. does showup in lookup ?
Thanx.
CASE1.
attrs1.put("description","It is my baseDN(sort of)");
dirContext.rebind("ou=newMurtuza",null,attrs1);
Object ob=dirContext.lookup("ou=newMurtuza");
System.out.println("named obj is "+ob);
Attributes gotAttrs=dirContext.getAttributes("ou=newMurtuza");
System.out.println("Attributes of gotAttrs= "+gotAttrs);
OUTPUT IS: named obj is com.sun.jndi.ldap.LdapCtx@56a499
Attributes of gotAttrs= No attributes
CASE 2.
String myObject="murtuza's base dn";
Attributes attrs1=new BasicAttributes();
attrs1.put("description","It is my baseDN(sort of)");
dirContext.rebind("ou=newMurtuza",myObject,attrs1);
Object ob=dirContext.lookup("ou=newMurtuza");
System.out.println("named obj is "+ob);
Attributes gotAttrs=dirContext.getAttributes("ou=newMurtuza");
System.out.println("Attributes of gotAttrs= "+gotAttrs);
OUTPUT IS: named obj is murtuza's base dn
Attributes of gotAttrs= {javaserializeddata=javaserializeddata: [B@175b59, ou=ou: newMurtuza, description=description: It is my baseDN(sort of), objectclass=objectclass: top, javaContainer, javaObject, javaSerializedObject, javaclassnames=javaclassnames: java.lang.String, java.lang.Object, java.io.Serializable, java.lang.Comparable, java.lang.CharSequence, javaclassname=javaclassname: java.lang.String}
<<Less