- 论坛徽章:
- 0
|
public static void main(String[] args) {
// Set up the environment for creating the initial context
LDAPConnection ld = null;
int status = -1;
try{
ld = new LDAPConnection();
/* Connect to server */
String MY_HOST = "huyan.com";
int MY_PORT = 16830;
ld.connect( MY_HOST, MY_PORT );
String MGR_DN = "cn=Directory Manager";
String MGR_PW = "managers";
ld.authenticate( MGR_DN, MGR_PW );
int day[]={1,2};
for(int j=0;j<=1;j++)
{
switch(day[j]){
case 1:try{String ENTRYDN = "cn=LMN_Creation,dc=Conference,dc=com";
/* Read all attributes */
LDAPEntry findEntry = ld.read( ENTRYDN );
。。。}catch{。。。。。}
case2:try{
String dn = "uid=huyan, ou=People, dc=Conference,dc=com";
/* Specify the attributes of the entry */
String objectclass_values[] = { "top",
"person",
"organizationalPerson",
"inetOrgPerson" };...
}
catch{。。。。}
}
catch{..}
...............
}
这个程序调试的时候没有错误 ,但是运行的时候就出现下面的结果,哪位能帮帮忙指点迷津,小女子先谢过了!!
cn=LMN_Creation,dc=Conference,dc=com
Attributes:
l
hubei
serialNumber
555-12456-AZ
description
Allocation of mixer for a local mixer network
objectClass
top
device
cn
LMN_Creation
creatorsName
cn=directory manager
modifiersName
cn=directory manager
createTimestamp
20060713083003Z
modifyTimestamp
20060713083003Z
Error: netscape.ldap.LDAPException: error result (20); Type or value exists
Error: netscape.ldap.LDAPException: error result (20); Type or value exists |
|