import java.io.Serializable; import java.util.Hashtable; import javax.naming.Context; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import javax.naming.directory.BasicAttributes; import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; import org.apache.log4j.Logger; /** * @author Kiran * */ public class LDAPInfo implements Serializable { private static Logger log = Logger .getLogger(LDAPInfo.class); private final static String CLASS_NAME = "LDAPInfo"; private static final long serialVersionUID = 19931047L; /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String userName = null; try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://dsxstage.m...
Blog about Programming.