connection.bind( "uid=admin,ou=system", "secret");
Dn adminDn = new Dn( "uid=admin,ou=system" );
ModifyRequest modReq = new ModifyRequestImpl();
modReq.setName( adminDn );
modReq.replace( SchemaConstants.USER_PASSWORD_AT, NEW_CONNECTION_PASSWORD );
connection.modify( modReq );
connection.close();
// check that we actually changed the admin connection password
connection = new LdapNetworkConnection( "localhost", 9999 );
connection.bind( "uid=admin,ou=system", NEW_CONNECTION_PASSWORD);