try
{
// Use the client API as JNDI cannot be used to do a search without
// first binding. (hmmm, even client API won't allow searching without binding)
connection.bind( "uid=admin,ou=system", "secret" );
// Searches for all the entries in ou=system
EntryCursor cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)",
SearchScope.OBJECT, "*" );