Associating a 'compare' operation to a 'search' operation is a nonsense.
Even worse, the JNDI 'Bind' operation is semantically a totally
confusing thing. Not to mention the traps you can fell in, one of the
most obvious is to forget to close a NamingEnumeration if you don't grab
all the results : closing the connection is not enough, the connection
is still considered as being locked. The perfect way to exhaust a pool
of connection, or to quickly get an OOM.

Did I mention the atrocious BasicAttributes() constructor which *must*
be used with a 'true' parameter, otherwise you will quickly have
problems when using case sensitive attributeType names ?