From: murali <gm...@tr...> - 2000-09-04 09:31:58
|
H ai i am facing some problem regarding LDAP. I am using some sample codes which arwe given in ldap client. I am using select command but it is giving exception message No:32. The number is for wrong name. The server i connected is Baylor.edu and other public ldap servers. Even i downloaded a ldap server for linux and tested it is giving the = same error Bye murali=20 email id: gm...@tr... the code i used is:: import netscape.ldap.*; import java.util.*; public class Search1 { public static void main( String[] args ) { =20 LDAPConnection ld =3D new LDAPConnection(); try { System.out.println("it has established the connection" + ld);=20 ld.connect( "172.16.5.64", 389 ); ld.authenticate(3,null,null); System.out.println("it is after the connection"); Float LDAPVersion =3D ( Float )ld.getProperty( = ld.LDAP_PROPERTY_PROTOCOL ); System.out.println( "Highest supported LDAP protocol version: " = + LDAPVersion ); System.out.println( "The default LDAP protocol version used is " = + ld.LDAP_VERSION=20 LDAPSearchResults results =3Dld.search("o=3Dairius.com", = LDAPv2.SCOPE_BASE, "(cn=3Djensen)", null, false ); System.out.println("it is before the while loop"); while ( results.hasMoreElements() ) { System.out.println("it has entrered into the while = loop");=20 LDAPEntry entry =3D null; entry =3D results.next(); System.out.println( entry.getDN() ); ld.disconnect(); } } =20 catch( LDAPException e ) { System.out.println( "Error: " + e.toString() ); System.out.println( "Error message: " + e.getLDAPErrorMessage() = ); System.exit(1); } System.exit(0); } } |