code: static public DatabaseClient newClient(String host, int port, String database,
            SecurityContext securityContext,
            DatabaseClient.ConnectionType connectionType)
  {
      OkHttpServices services = new OkHttpServices();
      services.connect(host, port, database, securityContext);
  
      if (clientConfigurator != null) {
        if ( clientConfigurator instanceof OkHttpClientConfigurator ) {
          OkHttpClient client = services.getClientImplementation();
          OkHttpClient.Builder clientBuilder = client.newBuilder();
          ((OkHttpClientConfigurator) clientConfigurator).configure(
            clientBuilder
          );
          ((OkHttpServices) services).setClientImplementation(clientBuilder.build());
        } else if ( clientConfigurator instanceof HttpClientConfigurator ) {
          // do nothing as we not longer use HttpClient so there's nothing this can configure
        } else {
          throw new IllegalArgumentException("A ClientConfigurator must implement OkHttpClientConfigurator");
        }
      }
  
      DatabaseClientImpl client = new DatabaseClientImpl(
            services, host, port, database, securityContext, connectionType
      );
      client.setHandleRegistry(getHandleRegistry().copy());
      return client;
    }
docs: Creates a client to access the database by means of a REST server.
  
  The CallManager interface can only call an endpoint for the configured content database
  of the appserver. You cannot specify the database when constructing a client for working
  with a CallManager.
  
  @param host the host with the REST server
  @param port the port for the REST server
  @param database the database to access (default: configured database for
  the REST server)
  @param securityContext the security context created depending upon the
  authentication type - BasicAuthContext, DigestAuthContext or KerberosAuthContext
  and communication channel type (SSL)
  @param connectionType whether the client connects directly to the MarkLogic host
  or using a gateway such as a load balancer
  @return a new client for making database requests