Driver extends AbstractDriver { @Override public Connection connect(String url, final Properties properties) throws SQLException { String id = this.parse(url); if (id == null) return null; Map.Entry<DriverProxyFactory, java.sql.Driver> entry = getProxyEntry(id, properties); TransactionContext<java.sql.Driver, DriverDatabase> context = new LocalTransactionContext<>(entry.getKey().getDatabaseCluster()); ConnectionProxyFactoryFactory<java.sql.Driver, DriverDatabase, java.sql.Driver> factory = new ConnectionProxyFactoryFactory<>(context); DriverInvoker<Connection> invoker = (DriverDatabase database, java.sql.Driver driver) -> driver.connect(database.getLocation(), properties); return factory.createProxyFactory(entry.getValue(), entry.getKey(), invoker, InvocationStrategies.INVOKE_ON_ALL.invoke(entry.getKey(), invoker)).createProxy(); }  static void close(String id); static void setFactory(DatabaseClusterFactory<java.sql.Driver, DriverDatabase> factory); static void setConfigurationFactory(String id, DatabaseClusterConfigurationFactory<java.sql.Driver, DriverDatabase> configurationFactory); @Override Connection connect(String url, final Properties properties); @Override DriverPropertyInfo[] getPropertyInfo(String url, final Properties properties); @Override java.util.logging.Logger getParentLogger();  }
@Test public void connect() throws Exception { this.connect("jdbc:ha-jdbc:cluster1", "cluster1"); this.connect("jdbc:ha-jdbc: this.connect("jdbc:ha-jdbc: }