public static Driver driver(URI uri,AuthToken authToken,Config config){
  String scheme=uri.getScheme();
  BoltServerAddress address=BoltServerAddress.from(uri);
  ConnectionSettings connectionSettings=new ConnectionSettings(authToken == null ? AuthTokens.none() : authToken);
  if (config == null) {
    config=Config.defaultConfig();
  }
  SecurityPlan securityPlan;
  try {
    securityPlan=createSecurityPlan(address,config);
  }
 catch (  GeneralSecurityException|IOException ex) {
    throw new ClientException("Unable to establish SSL parameters",ex);
  }
  DriverContract driverContract=new DriverContract(config.retryLogic());
  PoolSettings poolSettings=new PoolSettings(config.maxIdleConnectionPoolSize(),config.idleTimeBeforeConnectionTest());
  ConnectionPool connectionPool=new SocketConnectionPool(connectionSettings,securityPlan,poolSettings,config.logging());
switch (scheme.toLowerCase()) {
case "bolt":
    return new DirectDriver(address,driverContract,connectionPool,securityPlan,config.logging());
case "bolt+routing":
  return new RoutingDriver(config.routingSettings(),address,driverContract,connectionPool,securityPlan,Clock.SYSTEM,config.logging());
default :
throw new ClientException(format("Unsupported URI scheme: %s",scheme));
}
}

public static Driver driver ( URI uri , AuthToken authToken , Config config ) { String scheme = uri . getScheme ( ) ; BoltServerAddress address = BoltServerAddress . from ( uri ) ; ConnectionSettings connectionSettings = new ConnectionSettings ( authToken == null ? AuthTokens . none ( ) : authToken ) ; if ( config == null ) { config = Config . defaultConfig ( ) ; } SecurityPlan securityPlan ; try { securityPlan = createSecurityPlan ( address , config ) ; } catch ( GeneralSecurityException | IOException ex ) { throw new ClientException ( "Unable to establish SSL parameters" , ex ) ; } DriverContract driverContract = new DriverContract ( config . retryLogic ( ) ) ; PoolSettings poolSettings = new PoolSettings ( config . maxIdleConnectionPoolSize ( ) , config . idleTimeBeforeConnectionTest ( ) ) ; ConnectionPool connectionPool = new SocketConnectionPool ( connectionSettings , securityPlan , poolSettings , config . logging ( ) ) ; switch ( scheme . toLowerCase ( ) ) { case "bolt" : return new DirectDriver ( address , driverContract , connectionPool , securityPlan , config . logging ( ) ) ; case "bolt+routing" : return new RoutingDriver ( config . routingSettings ( ) , address , driverContract , connectionPool , securityPlan , Clock . SYSTEM , config . logging ( ) ) ; default : throw new ClientException ( format ( "Unsupported URI scheme: %s" , scheme ) ) ; } }
return a driver for a neo4j instance with custom configuration .
