On 6/7/06 8:10, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Following to my previous topic, I've got an answer that I can use
> the method
> $mesg->count() in order to obtain the query's result count.
>
> I would like to know, how can I join this method in the following
> code:
> ...
> String dirStr = <certain value>
> searchControls.setReturningObjFlag(false);
> searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
> searchControls.setReturningAttributes(retAtt);
> searchControls.setCountLimit(countLimit_No_Limit);
>
> StringBuffer filter = new StringBuffer();
>
> filter.append("(&(objectclass=<a certain object class>)");
>
> filter.append("(");
> filter.append("certain field=");
> filter.append(<certain value>);
> filter.append("))");
>
>
> NamingEnumeration answer = context.search(dirStr, filter.toString(),
> searchControls);
>
>
> if (!answer.hasMore()) {
> return 0l;
> }
>
> int resultsNumbert = 0;
> while (answer.hasMoreElements()) {
> SearchResult searchResult = (SearchResult)answer.next();
> resultsNumbert++;
> }
> ...
> return resultsNumbert;
>
>
> Here I count the results myself . What I would like to know, is how
> to use the method :
> $mesg->count() in order to get the results count
>
> Thank you in advance for your answer
The code you posted was written in (what looks like) Java. Net::LDAP is
written in perl.
You need to ask your question on a Java list!
Cheers,
Chris