I would recommend you look at using one of the API available in java to connect to the LDAP server, I have no experience but people seem to like
unboundid[
^]
or
Spring[
^]
Once you have an API in mind it should be easier to find examples with google.
/Darren