@Test void testConnect() throws Exception { System.getProperties().put("property.0.url", "jdbc:h2:mem:test"); Connection connection = DriverManager.getConnection("jdbc:property:0"); System.getProperties().remove("property.0.url"); assertNotNull(connection); }
public Connection connect(String url, Properties info) throws SQLException { String name = url.substring("jdbc:property:".length()); String delegateUrl = null; Properties delegateProperties = new Properties(); for (String key : System.getProperties().stringPropertyNames()) { if (key.startsWith("property." + name + ".url")) { delegateUrl = System.getProperty("property." + name + ".url"); } } Driver driver = DriverManager.getDriver(delegateUrl); return driver.connect(delegateUrl, delegateProperties); }
PropertyDriver implements Driver { public Connection connect(String url, Properties info) throws SQLException { String name = url.substring("jdbc:property:".length()); String delegateUrl = null; Properties delegateProperties = new Properties(); for (String key : System.getProperties().stringPropertyNames()) { if (key.startsWith("property." + name + ".url")) { delegateUrl = System.getProperty("property." + name + ".url"); } } Driver driver = DriverManager.getDriver(delegateUrl); return driver.connect(delegateUrl, delegateProperties); } }
PropertyDriver implements Driver { public Connection connect(String url, Properties info) throws SQLException { String name = url.substring("jdbc:property:".length()); String delegateUrl = null; Properties delegateProperties = new Properties(); for (String key : System.getProperties().stringPropertyNames()) { if (key.startsWith("property." + name + ".url")) { delegateUrl = System.getProperty("property." + name + ".url"); } } Driver driver = DriverManager.getDriver(delegateUrl); return driver.connect(delegateUrl, delegateProperties); } PropertyDriver(); }
PropertyDriver implements Driver { public Connection connect(String url, Properties info) throws SQLException { String name = url.substring("jdbc:property:".length()); String delegateUrl = null; Properties delegateProperties = new Properties(); for (String key : System.getProperties().stringPropertyNames()) { if (key.startsWith("property." + name + ".url")) { delegateUrl = System.getProperty("property." + name + ".url"); } } Driver driver = DriverManager.getDriver(delegateUrl); return driver.connect(delegateUrl, delegateProperties); } PropertyDriver(); Connection connect(String url, Properties info); boolean acceptsURL(String url); DriverPropertyInfo[] getPropertyInfo(String url, Properties info); int getMajorVersion(); int getMinorVersion(); boolean jdbcCompliant(); Logger getParentLogger(); }
PropertyDriver implements Driver { public Connection connect(String url, Properties info) throws SQLException { String name = url.substring("jdbc:property:".length()); String delegateUrl = null; Properties delegateProperties = new Properties(); for (String key : System.getProperties().stringPropertyNames()) { if (key.startsWith("property." + name + ".url")) { delegateUrl = System.getProperty("property." + name + ".url"); } } Driver driver = DriverManager.getDriver(delegateUrl); return driver.connect(delegateUrl, delegateProperties); } PropertyDriver(); Connection connect(String url, Properties info); boolean acceptsURL(String url); DriverPropertyInfo[] getPropertyInfo(String url, Properties info); int getMajorVersion(); int getMinorVersion(); boolean jdbcCompliant(); Logger getParentLogger();  }