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 1374 게시물 읽기
No. 1374
Re: [질문] LDAP 연동 자바프로그래밍
작성자
이진희
작성일
2002-02-08 12:20
조회수
4,981

허... connect 를 하고 바인드를 하지 않으셨군요.

아래와 같이 manager 로 바인딩을 하셔야 자료를 수정할 수 있겠죠?

기본적으로 디렉토리에 대해 더 공부를 하셔야 할듯합니다.

유닉스같은 경우 ldapclient 데몬이 설치되어 있어(솔라리스인경우) 조회 및 수정 명령문을 실습해 볼 수 있습니다.

프로그래밍 하기 전에 이 명령어에 대해 먼저 알아보세요.

 

/* Authenticate to the server as directory manager */

String MGR_DN = "cn=Manager,ou=lgcns,o=lg,c=KR";

String MGR_PW = "manager";

ld.authenticate( MGR_DN, MGR_PW );

 

 

 

 

 

 

 

-- 김규남 님이 쓰신 글:

>> 여기있는 강좌를 참조해서 해봤는데, 잘 안됩니다. ㅠ.ㅠ

>>

>> 제가 하고 싶은 것은 특정값을 수정하는 건데요. 자세히 말씀드리자면...

>> 디렉토리 구조는

>> .o=project.net

>> ou=Marketsite

>> ou=TradingPartners

>> ou=sscom

>> ou=members

>> ou=admin

>> cn=msbisdisabled

>> 이렇게 돼있구요.(사실, o,ou,cn 이 뭔지도 모른답니다. ㅠ.ㅠ)

>> 여기서 cn의 값이 2로 되어있는데 이것을 0으로 바꿔주고 싶거든요.

>>

>> 혹시 LDAP 과 연동하여 써보신 분 있으시면 답변 부탁드립니다.

>> 감사합니다....ㅠ.ㅠ

>>

>> 아래는 제가 만든 소스입니다. 에러 메세지로는

>> "No such entry" 이것이 뜨네요...

>>

>> -------------------------------------------------------------------

>>
>> import netscape.ldap.*;
>> 
>> public class ModAttrs{
>>     public static void main(String[] args){
>> 		String ENTRYDN = "cn=msbisdisabled, ou=admin, ou=Members, ou=sscom, ou=TradingPartners, ou=marketsite, o=project.net";
>> 			
>> 		LDAPModificationSet mods = new LDAPModificationSet();
>> 		LDAPAttribute attrEmail = new LDAPAttribute( "msbisdisabled", "0" );
>> 		mods.add( LDAPModification.REPLACE, attrEmail );
>> 
>> 		LDAPConnection ld = null;
>> 		int status = -1;
>> 		try {
>> 			ld = new LDAPConnection();
>> 			/* Connect to server */
>> 			String MY_HOST = "localhost";
>> 			int MY_PORT = 389;
>> 			ld.connect( MY_HOST, MY_PORT );
>> 
>> 			/* Now modify the entry in the directory */
>> 			ld.modify( ENTRYDN, mods );
>> 			System.out.println( "Entry modified"  );
>> 		}
>> 		catch( LDAPException e ) {
>> 			if ( e.getLDAPResultCode() == LDAPException.NO_SUCH_OBJECT )
>> 				System.out.println( "Error: No such entry" );
>> 			else if ( e.getLDAPResultCode() ==
>> 					  LDAPException.INSUFFICIENT_ACCESS_RIGHTS )
>> 				System.out.println( "Error: Insufficient rights" );
>> 			else if ( e.getLDAPResultCode() ==
>> 					  LDAPException.ATTRIBUTE_OR_VALUE_EXISTS )
>> 				System.out.println( "Error: Attribute or value exists" );
>> 			else
>> 				System.out.println( "Error: " + e.toString() );
>> 		}
>> 
>> 		/* Done, so disconnect */
>> 		if ( (ld != null) && ld.isConnected() ) {
>> 			try {
>> 			    ld.disconnect();
>> 			} catch ( LDAPException e ) {
>> 				System.out.println( "Error: " + e.toString() );
>> 			}
>> 		}
>> 		System.exit(status);
>>     }
>> }
>> 
[Top]
No.
제목
작성자
작성일
조회
1371LDAP test toolkit
김연수
2002-02-07
4622
1373┕>Re: LDAP test toolkit
김태성
2002-02-07 21:54:07
4854
1370[질문]OpenLDAP 사용중 질문요. [1]
유제현
2002-02-06
4481
1369클라이언트 프로그램
노상운
2002-02-06
4517
1375┕>Re: 클라이언트 프로그램
이진희
2002-02-08 12:27:35
5029
1368[질문] LDAP 연동 자바프로그래밍
김규남
2002-02-05
4300
1374┕>Re: [질문] LDAP 연동 자바프로그래밍
이진희
2002-02-08 12:20:36
4981
1367ldap 클라이언트 [1]
노상운
2002-02-04
4612
1365LDAP(pam_ldap) 인증과정중에 문제가..
박태수
2002-02-02
4780
1366┕>-.-; 문제 해결 햇씜다~ (역쉬 닭질이 짱임다여~) [1]
박티룽
2002-02-03 03:26:23
4818
1363[질문]openLDAP 사용시에... [1]
이종국
2002-01-31
4388
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.018초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다