Create a new LDAPConnection object, and set any preferences that you want applied to all LDAP operations. (See "Creating a Connection and Setting Preferences" for details.)
Connect to an LDAP server. (See "Connecting to the LDAP Server" for details.)
If necessary, bind to the LDAP server. If you intend to use any of the LDAP v3 features (such as controls or extended operations), specify the version of LDAP supported by your client. (See "Binding and Authenticating to an LDAP Server" for details.)
Perform the operations (for example, search the directory or modify entries in the directory). (See "Performing LDAP Operations" for details.)
When you are done, disconnect from the LDAP server. (See "Closing the Connection to the Server" for details.)