Using Search Filters

You should type in the code or load it from the CD-ROM and compile, using the following command:

						javac FilterSearch.java
					

Let's execute some searches and see what different filters return:

						java FilterSearch localhost 389 "" "" "o=airius.com" "(cn=sam carter)"
						java FilterSearch localhost 389 "" "" "o=airius.com" "(cn=Sam Carter)"
					

These two commands will return the same single record, demonstrating that case does not matter in a search for the common name (which is defined in the LDAP server as a case-insensitive attribute):

						dn: uid=scarter, ou=People, o=airius.com
						cn: Sam Carter
						mail: scarter@airius.com
						telephoneNumber: +1 408 555 4798
					

Now let's try a more complex search filter. The following request will return a series ...

Get LDAP Programming with Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.