database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
ㆍLDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
LDAP Q&A 1003 게시물 읽기
No. 1003
[질문] iPlanet과 JNDI를 이용해서 EntryAdd도중에..
작성자
김윤한
작성일
2001-09-03 10:44
조회수
8,595

iPlanet과 JNDI를 이용해서 Entry를 하나 Add시키려고 하는데요.

실행시키면 에러는 발생하지 않는데 한없이 기다리기만 하네요..

뭐가 잘못된 건가요?

답변 부탁드립니다.. ㅠ.ㅠ

 

import javax.naming.*;

import javax.naming.Context;

import javax.naming.directory.*;

import javax.naming.NamingException;

import java.util.*;

import java.io.*;

 

public class AddEntry {

 

// 환경 변수 세팅

private static final String HOST = "ldap://localhost:389";

private static final String DN = "cn=admin,dc=ssu,dc=ac,dc=kr";

private static final String PW = "password";

public static String SEARCH_BASE = "uid=*,dc=ssu,dc=ac,dc=kr";

 

public static void main(String[] args)

throws Exception

{

String Dn = new String("uid=spbear,ou=People, dc=ssu,dc=ac,dc=kr");

 

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");

env.put(Context.PROVIDER_URL, HOST);

env.put(Context.SECURITY_PRINCIPAL, DN);

env.put(Context.SECURITY_PRINCIPAL, PW);

 

DirContext ctx = new InitialDirContext(env);

 

Attributes attrs = new BasicAttributes(true);

Attribute objClass = new BasicAttribute("objectclass");

objClass.add("inetOrgPerson");

objClass.add("organizationalPerson");

objClass.add("person");

objClass.add("top");

attrs.put(objClass);

attrs.put(new BasicAttribute("givenName", "BUSEO"));

attrs.put(new BasicAttribute("cn", "Yunhan Kim"));

attrs.put(new BasicAttribute("uid", "spbear"));

attrs.put(new BasicAttribute("sn", "Kim"));

attrs.put(new BasicAttribute("userpassword", "PASS"));

 

try{

Context result = ctx.createSubcontext(Dn, attrs);

System.out.println(attrs.get("cn").get()+"님 등록 완료되었습니다. " );

System.out.println(attrs.toString());

}catch (Exception ex) {

ex.printStackTrace();

System.out.println("Add Operation Error !");

}

 

try{

System.out.println("부서 : " + attrs.get("givenname").get());

System.out.println(attrs.toString());

System.out.println("직위 : " + attrs.get("sn").get());

System.out.println(attrs.toString());

System.out.println("사번 : " + attrs.get("uid").get());

System.out.println(attrs.toString());

System.out.println("성명 : " + attrs.get("cn").get());

System.out.println(attrs.toString());

}catch (Exception ex) {

System.out.println("Print Operation Error !");

}

}

 

}

[Top]
No.
제목
작성자
작성일
조회
1010syntax를 여러개 지정할 수도 있나요?
이수진
2001-09-04
8299
1012┕>Re: syntax를 여러개 지정할 수도 있나요?
박근오
2001-09-04 21:23:28
8480
1013 ┕>Re: Re: syntax를 여러개 지정할 수도 있나요?
이수진
2001-09-05 11:35:10
8769
1017  ┕>Re: Re: Re: syntax를 여러개 지정할 수도 있나요?
송상준
2001-09-05 18:34:59
8946
1018  ┕>Re: Re: Re: syntax를 여러개 지정할 수도 있나요?
박근오
2001-09-05 20:46:37
8538
1009[질문]connection pool ?
param
2001-09-03
8695
1011┕>Re: [질문]connection pool ?
박근오
2001-09-04 21:07:32
9308
1005[질문]search할 때 or 조건을 쓸 수 있나요?
param
2001-09-03
8406
1007┕>Re: [질문]search할 때 or 조건을 쓸 수 있나요?
박근오
2001-09-03 16:33:39
9174
1003[질문] iPlanet과 JNDI를 이용해서 EntryAdd도중에..
김윤한
2001-09-03
8595
1006┕>Re: [질문] iPlanet과 JNDI를 이용해서 EntryAdd도중에..
이수진
2001-09-03 11:50:46
9110
999Netscape Directory server와 openLDAP의 스키마.
이수진
2001-08-31
6468
1001┕>Re: Netscape Directory server와 openLDAP의 스키마.
양재웅
2001-09-01 15:17:12
8758
1004 ┕>Re: Re: Netscape Directory server와 openLDAP의 스키마.
이수진
2001-09-03 11:32:02
8540
1008  ┕>Re: Re: Re: Netscape Directory server와 openLDAP의 스키마.
양재웅
2001-09-03 17:32:03
8980
986LDAP Server 접근을 어떻게 해야 하죠?
김상헌
2001-08-30
6421
990┕>Re: LDAP Server 접근을 어떻게 해야 하죠?
박근오
2001-08-30 16:43:02
7284
997┕>Re: LDAP Server 접근을 어떻게 해야 하죠?
송상준
2001-08-31 09:41:16
7487
971win98용 LDAP클라이언트 컴파일
김기홍
2001-08-29
7031
979┕>Re: win98용 LDAP클라이언트 컴파일
박근오
2001-08-29 21:19:10
7691
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.020초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다