Hello,

I'm writing an application, which should interoperate with
my openldap-Server (2.1.4)

So I downloaded the source for the Directory SDK 4.1
and, after correcting 2 minor errors, got it to compile.

Now I can connect to the server and retrieve results, fine.

LDAPConnection ld=new LDAPConnection;
ld.connnect(<something>);
LDAPResult res=ld.search(base,LDAPConnection.SCOPE_SUB
    ,filter,attribs,false);

If I now ask res.getCount(), I get very strange results.

sometimes it gives 1 (if currently 2 entries matched)
sometimes it gives 2 (if currently 4 entries matched)

only "right" thing (to my mind) is, if no entry matched, 0 is returned.

What is the reason for that?
Is it a bug?

If I iterate through the result using res.hasMoreElements()
and res.next() I got all matching entries.

Any help appreciated
Regards
Ingo Schaefer



Reply via email to