JAVA_基本LDAP操作.docVIP

  • 3
  • 0
  • 约3.56千字
  • 约 5页
  • 2017-06-10 发布于天津
  • 举报
JAVA_基本LDAP操作.doc

一、简介   Lightweight Directory Access Protocol (LDAP),轻型目录访问协议是一个访问在线目录服务的协议。下面的例子中简单介绍在java中队ldap的增删该查功能。目录结构为:   CD=CAS,DC=MYDC   --cn=users   ----uid=zhangsan   二、示例   1、通过LdapContext连接ldap   [java]   /**   * 连接LDAP   */   @SuppressWarnings({ rawtypes, unchecked })   public LdapContext connetLDAP() throws NamingException {   // 连接Ldap需要的信息   String ldapFactory = com.sun.jndi.ldap.LdapCtxFactory;   String ldapUrl = ldap:/IP:port;// url   String ldapAccount = cn=root; // 用户名   String ldapPwd = password;//密码   Hashtable env = new Hashtable();   env.put(Context.INITIAL_CONTEXT_FACTORY, ldapFactor

文档评论(0)

1亿VIP精品文档

相关文档