@Test public void testBuildEmbeedURL() { JDBCURL url = new JDBCURL("vdb", "/home/foo/deploy.properties", new Properties()); assertEquals("jdbc:teiid:vdb@/home/foo/deploy.properties", url.getJDBCURL()); Properties p = new Properties(); p.setProperty("user", "test"); p.setProperty("password", "pass"); p.setProperty("autoFailover", "true"); p.setProperty("any", "thing"); url = new JDBCURL("vdb", "/home/foo/deploy.properties", p); assertTrue(url.getJDBCURL().startsWith("jdbc:teiid:vdb@/home/foo/deploy.properties;")); assertTrue(url.getJDBCURL().indexOf("any=thing")!=-1); assertTrue(url.getJDBCURL().indexOf("password=pass")!=-1); assertTrue(url.getJDBCURL().indexOf("autoFailover=true")!=-1); }
public String getJDBCURL() { if (urlString == null) { StringBuffer buf = new StringBuffer(JDBC_PROTOCOL) .append(safeEncode(vdbName)); if (this.connectionURL != null) { buf.append('@').append(connectionURL); } TreeMap sorted = new TreeMap(); sorted.putAll(properties); for (Iterator i = sorted.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry)i.next(); if (entry.getValue() instanceof String) { buf.append(';') .append(entry.getKey()) .append('=') .append(safeEncode((String)entry.getValue())); } } urlString = buf.toString(); } return urlString; }
JDBCURL { public String getJDBCURL() { if (urlString == null) { StringBuffer buf = new StringBuffer(JDBC_PROTOCOL) .append(safeEncode(vdbName)); if (this.connectionURL != null) { buf.append('@').append(connectionURL); } TreeMap sorted = new TreeMap(); sorted.putAll(properties); for (Iterator i = sorted.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry)i.next(); if (entry.getValue() instanceof String) { buf.append(';') .append(entry.getKey()) .append('=') .append(safeEncode((String)entry.getValue())); } } urlString = buf.toString(); } return urlString; } }
JDBCURL { public String getJDBCURL() { if (urlString == null) { StringBuffer buf = new StringBuffer(JDBC_PROTOCOL) .append(safeEncode(vdbName)); if (this.connectionURL != null) { buf.append('@').append(connectionURL); } TreeMap sorted = new TreeMap(); sorted.putAll(properties); for (Iterator i = sorted.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry)i.next(); if (entry.getValue() instanceof String) { buf.append(';') .append(entry.getKey()) .append('=') .append(safeEncode((String)entry.getValue())); } } urlString = buf.toString(); } return urlString; } JDBCURL(String jdbcURL);  JDBCURL(String vdbName, String connectionURL, Properties props); }
JDBCURL { public String getJDBCURL() { if (urlString == null) { StringBuffer buf = new StringBuffer(JDBC_PROTOCOL) .append(safeEncode(vdbName)); if (this.connectionURL != null) { buf.append('@').append(connectionURL); } TreeMap sorted = new TreeMap(); sorted.putAll(properties); for (Iterator i = sorted.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry)i.next(); if (entry.getValue() instanceof String) { buf.append(';') .append(entry.getKey()) .append('=') .append(safeEncode((String)entry.getValue())); } } urlString = buf.toString(); } return urlString; } JDBCURL(String jdbcURL);  JDBCURL(String vdbName, String connectionURL, Properties props); static ConnectionType acceptsUrl(String url); String getVDBName(); String getConnectionURL(); Properties getProperties(); static void parseConnectionProperties(String connectionInfo, Properties p); String getJDBCURL(); String getProperty(String key); String getUserName(); String getPassword(); String getVDBVersion(); String getTransactionAutowrapMode(); String getPartialResultsMode(); String getResultSetCacheMode(); String getAnsiQuotedIdentifiers(); String getFetchSize(); String getTransparentFailover(); String getDisableLocalTransactions(); String toString(); static void addNormalizedProperty(String key, Object value, Properties target); static String getValidKey(String key); static Properties normalizeProperties(Properties props); }
JDBCURL { public String getJDBCURL() { if (urlString == null) { StringBuffer buf = new StringBuffer(JDBC_PROTOCOL) .append(safeEncode(vdbName)); if (this.connectionURL != null) { buf.append('@').append(connectionURL); } TreeMap sorted = new TreeMap(); sorted.putAll(properties); for (Iterator i = sorted.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry)i.next(); if (entry.getValue() instanceof String) { buf.append(';') .append(entry.getKey()) .append('=') .append(safeEncode((String)entry.getValue())); } } urlString = buf.toString(); } return urlString; } JDBCURL(String jdbcURL);  JDBCURL(String vdbName, String connectionURL, Properties props); static ConnectionType acceptsUrl(String url); String getVDBName(); String getConnectionURL(); Properties getProperties(); static void parseConnectionProperties(String connectionInfo, Properties p); String getJDBCURL(); String getProperty(String key); String getUserName(); String getPassword(); String getVDBVersion(); String getTransactionAutowrapMode(); String getPartialResultsMode(); String getResultSetCacheMode(); String getAnsiQuotedIdentifiers(); String getFetchSize(); String getTransparentFailover(); String getDisableLocalTransactions(); String toString(); static void addNormalizedProperty(String key, Object value, Properties target); static String getValidKey(String key); static Properties normalizeProperties(Properties props); static final String JDBC_PROTOCOL; static final Map<String, String> EXECUTION_PROPERTIES; static final Map<String, String> KNOWN_PROPERTIES; }