@Override public Connection connect(String url, Properties info) throws SQLException { if (!acceptsURL(url)) { return null; } return createConnection(url, info); }
protected final Connection createConnection(String url, Properties info) throws SQLException { Properties augmentedInfo = PropertiesUtil.deepCopy(info); augmentedInfo.putAll(getDefaultProps().asMap()); ConnectionQueryServices connectionServices = getConnectionQueryServices(url, augmentedInfo); PhoenixConnection connection = connectionServices.connect(url, augmentedInfo); return connection; }
@Override public synchronized Connection connect(String url, Properties info) throws SQLException { checkClosed(); return super.connect(url, info); }
@Override public boolean acceptsURL(String url) throws SQLException { // Accept the url only if test=true attribute not set return super.acceptsURL(url) && !isTestUrl(url); }
protected static boolean destroyDriver(Driver driver) { if (driver != null) { assert(driver instanceof PhoenixEmbeddedDriver); PhoenixEmbeddedDriver pdriver = (PhoenixEmbeddedDriver)driver; try { try { pdriver.close(); return true; } finally { DriverManager.deregisterDriver(driver); } } catch (Exception e) { logger.warn("Unable to close registered driver: " + driver, e); } } return false; }
@Override public boolean acceptsURL(String url) throws SQLException { // Accept the url only if test=true attribute set return super.acceptsURL(url) && isTestUrl(url); }
private static void startServer(String url) throws Exception { assertNull(driver); // only load the test driver if we are testing locally - for integration tests, we want to // test on a wider scale if (PhoenixEmbeddedDriver.isTestUrl(url)) { driver = initDriver(ReadOnlyProps.EMPTY_PROPS); assertTrue(DriverManager.getDriver(url) == driver); driver.connect(url, PropertiesUtil.deepCopy(TEST_PROPERTIES)); } }
@Override public Connection connect(String url, Properties info) throws SQLException { if (!acceptsURL(url)) { return null; } return createConnection(url, info); }
protected final Connection createConnection(String url, Properties info) throws SQLException { Properties augmentedInfo = PropertiesUtil.deepCopy(info); augmentedInfo.putAll(getDefaultProps().asMap()); ConnectionQueryServices connectionServices = getConnectionQueryServices(url, augmentedInfo); PhoenixConnection connection = connectionServices.connect(url, augmentedInfo); return connection; }
@Override public boolean acceptsURL(String url) throws SQLException { // Accept the url only if test=true attribute not set return super.acceptsURL(url) && !isTestUrl(url); }
@Override public Connection connect(String url, Properties info) throws SQLException { if (!acceptsURL(url)) { return null; } return createConnection(url, info); }
protected final Connection createConnection(String url, Properties info) throws SQLException { Properties augmentedInfo = PropertiesUtil.deepCopy(info); augmentedInfo.putAll(getDefaultProps().asMap()); ConnectionQueryServices connectionServices = getConnectionQueryServices(url, augmentedInfo); PhoenixConnection connection = connectionServices.connect(url, augmentedInfo); return connection; }
@Override public boolean acceptsURL(String url) throws SQLException { // Accept the url only if test=true attribute not set return super.acceptsURL(url) && !isTestUrl(url); }