@Test public void testParseURL() throws Exception{ Properties p = new Properties(); TeiidDriver.parseURL("jdbc:teiid:BQT@mm: assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mm: assertEquals(3, p.size()); }
protected static void parseURL(String url, Properties info) throws SQLException { if(url == null) { String msg = JDBCPlugin.Util.getString("MMDriver.urlFormat"); throw new TeiidSQLException(msg); } try { JDBCURL jdbcURL = new JDBCURL(url); info.setProperty(BaseDataSource.VDB_NAME, jdbcURL.getVDBName()); if (jdbcURL.getConnectionURL() != null) { info.setProperty(TeiidURL.CONNECTION.SERVER_URL, jdbcURL.getConnectionURL()); } Properties optionalParams = jdbcURL.getProperties(); JDBCURL.normalizeProperties(info); Enumeration<?> keys = optionalParams.keys(); while (keys.hasMoreElements()) { String propName = (String)keys.nextElement(); if (!info.containsKey(propName)) { info.setProperty(propName, optionalParams.getProperty(propName)); } } if(!info.containsKey(BaseDataSource.VDB_VERSION) && jdbcURL.getVDBVersion() != null) { info.setProperty(BaseDataSource.VDB_VERSION, jdbcURL.getVDBVersion()); } if(!info.containsKey(BaseDataSource.APP_NAME)) { info.setProperty(BaseDataSource.APP_NAME, BaseDataSource.DEFAULT_APP_NAME); } } catch(IllegalArgumentException iae) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMDriver.urlFormat")); } }
TeiidDriver implements Driver { protected static void parseURL(String url, Properties info) throws SQLException { if(url == null) { String msg = JDBCPlugin.Util.getString("MMDriver.urlFormat"); throw new TeiidSQLException(msg); } try { JDBCURL jdbcURL = new JDBCURL(url); info.setProperty(BaseDataSource.VDB_NAME, jdbcURL.getVDBName()); if (jdbcURL.getConnectionURL() != null) { info.setProperty(TeiidURL.CONNECTION.SERVER_URL, jdbcURL.getConnectionURL()); } Properties optionalParams = jdbcURL.getProperties(); JDBCURL.normalizeProperties(info); Enumeration<?> keys = optionalParams.keys(); while (keys.hasMoreElements()) { String propName = (String)keys.nextElement(); if (!info.containsKey(propName)) { info.setProperty(propName, optionalParams.getProperty(propName)); } } if(!info.containsKey(BaseDataSource.VDB_VERSION) && jdbcURL.getVDBVersion() != null) { info.setProperty(BaseDataSource.VDB_VERSION, jdbcURL.getVDBVersion()); } if(!info.containsKey(BaseDataSource.APP_NAME)) { info.setProperty(BaseDataSource.APP_NAME, BaseDataSource.DEFAULT_APP_NAME); } } catch(IllegalArgumentException iae) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMDriver.urlFormat")); } } }
TeiidDriver implements Driver { protected static void parseURL(String url, Properties info) throws SQLException { if(url == null) { String msg = JDBCPlugin.Util.getString("MMDriver.urlFormat"); throw new TeiidSQLException(msg); } try { JDBCURL jdbcURL = new JDBCURL(url); info.setProperty(BaseDataSource.VDB_NAME, jdbcURL.getVDBName()); if (jdbcURL.getConnectionURL() != null) { info.setProperty(TeiidURL.CONNECTION.SERVER_URL, jdbcURL.getConnectionURL()); } Properties optionalParams = jdbcURL.getProperties(); JDBCURL.normalizeProperties(info); Enumeration<?> keys = optionalParams.keys(); while (keys.hasMoreElements()) { String propName = (String)keys.nextElement(); if (!info.containsKey(propName)) { info.setProperty(propName, optionalParams.getProperty(propName)); } } if(!info.containsKey(BaseDataSource.VDB_VERSION) && jdbcURL.getVDBVersion() != null) { info.setProperty(BaseDataSource.VDB_VERSION, jdbcURL.getVDBVersion()); } if(!info.containsKey(BaseDataSource.APP_NAME)) { info.setProperty(BaseDataSource.APP_NAME, BaseDataSource.DEFAULT_APP_NAME); } } catch(IllegalArgumentException iae) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMDriver.urlFormat")); } }  }
TeiidDriver implements Driver { protected static void parseURL(String url, Properties info) throws SQLException { if(url == null) { String msg = JDBCPlugin.Util.getString("MMDriver.urlFormat"); throw new TeiidSQLException(msg); } try { JDBCURL jdbcURL = new JDBCURL(url); info.setProperty(BaseDataSource.VDB_NAME, jdbcURL.getVDBName()); if (jdbcURL.getConnectionURL() != null) { info.setProperty(TeiidURL.CONNECTION.SERVER_URL, jdbcURL.getConnectionURL()); } Properties optionalParams = jdbcURL.getProperties(); JDBCURL.normalizeProperties(info); Enumeration<?> keys = optionalParams.keys(); while (keys.hasMoreElements()) { String propName = (String)keys.nextElement(); if (!info.containsKey(propName)) { info.setProperty(propName, optionalParams.getProperty(propName)); } } if(!info.containsKey(BaseDataSource.VDB_VERSION) && jdbcURL.getVDBVersion() != null) { info.setProperty(BaseDataSource.VDB_VERSION, jdbcURL.getVDBVersion()); } if(!info.containsKey(BaseDataSource.APP_NAME)) { info.setProperty(BaseDataSource.APP_NAME, BaseDataSource.DEFAULT_APP_NAME); } } catch(IllegalArgumentException iae) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMDriver.urlFormat")); } }  static TeiidDriver getInstance(); ConnectionImpl connect(String url, Properties info); void setLocalProfile(ConnectionProfile embeddedProfile); void setSocketProfile(ConnectionProfile socketProfile); boolean acceptsURL(String url); int getMajorVersion(); int getMinorVersion(); String getDriverName(); DriverPropertyInfo[] getPropertyInfo(String url, Properties info); boolean jdbcCompliant(); Logger getParentLogger(); }
TeiidDriver implements Driver { protected static void parseURL(String url, Properties info) throws SQLException { if(url == null) { String msg = JDBCPlugin.Util.getString("MMDriver.urlFormat"); throw new TeiidSQLException(msg); } try { JDBCURL jdbcURL = new JDBCURL(url); info.setProperty(BaseDataSource.VDB_NAME, jdbcURL.getVDBName()); if (jdbcURL.getConnectionURL() != null) { info.setProperty(TeiidURL.CONNECTION.SERVER_URL, jdbcURL.getConnectionURL()); } Properties optionalParams = jdbcURL.getProperties(); JDBCURL.normalizeProperties(info); Enumeration<?> keys = optionalParams.keys(); while (keys.hasMoreElements()) { String propName = (String)keys.nextElement(); if (!info.containsKey(propName)) { info.setProperty(propName, optionalParams.getProperty(propName)); } } if(!info.containsKey(BaseDataSource.VDB_VERSION) && jdbcURL.getVDBVersion() != null) { info.setProperty(BaseDataSource.VDB_VERSION, jdbcURL.getVDBVersion()); } if(!info.containsKey(BaseDataSource.APP_NAME)) { info.setProperty(BaseDataSource.APP_NAME, BaseDataSource.DEFAULT_APP_NAME); } } catch(IllegalArgumentException iae) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMDriver.urlFormat")); } }  static TeiidDriver getInstance(); ConnectionImpl connect(String url, Properties info); void setLocalProfile(ConnectionProfile embeddedProfile); void setSocketProfile(ConnectionProfile socketProfile); boolean acceptsURL(String url); int getMajorVersion(); int getMinorVersion(); String getDriverName(); DriverPropertyInfo[] getPropertyInfo(String url, Properties info); boolean jdbcCompliant(); Logger getParentLogger();  }