/** * @see java.lang.Object#toString() */ public String toString() { try { return buildURL().getJDBCURL(); } catch (TeiidSQLException e) { return e.getMessage(); } }
/** * @see java.lang.Object#toString() */ public String toString() { try { return buildURL().getJDBCURL(); } catch (TeiidSQLException e) { return e.getMessage(); } }
public void helpTestAlternateServer(String altServers, boolean valid) { this.dataSource.setAlternateServers(altServers); try { this.dataSource.buildURL(); if (!valid) { fail("expected exception"); } } catch (TeiidSQLException e) { if (valid) { throw new RuntimeException(e); } } }
public void testBuildURLEncryptRequests() throws TeiidSQLException { final TeiidDataSource ds = new TeiidDataSource(); ds.setServerName("hostName"); //$NON-NLS-1$ ds.setDatabaseName("vdbName"); //$NON-NLS-1$ ds.setEncryptRequests(true); compareUrls("jdbc:teiid:vdbName@mm://hostname:0;fetchSize=2048;ApplicationName=JDBC;encryptRequests=true;VirtualDatabaseName=vdbName", ds.buildURL().getJDBCURL()); //$NON-NLS-1$ }
public void testBuildURL_AdditionalProperties() throws TeiidSQLException { final TeiidDataSource ds = new TeiidDataSource(); ds.setAdditionalProperties("foo=bar;a=b"); //$NON-NLS-1$ ds.setServerName("hostName"); //$NON-NLS-1$ ds.setDatabaseName("vdbName"); //$NON-NLS-1$ ds.setPortNumber(1); assertEquals("jdbc:teiid:vdbName@mm://hostname:1;ApplicationName=JDBC;VirtualDatabaseName=vdbName;a=b;fetchSize=2048;foo=bar", ds.buildURL().getJDBCURL()); //$NON-NLS-1$ }
public void testKerberos() throws SQLException { TeiidDataSource tds = new TeiidDataSource(); tds.setDatabaseName("y"); tds.setUser("%25user"); tds.setJaasName("x"); tds.setKerberosServicePrincipleName("z"); tds.setServerName("t"); compareUrls("jdbc:teiid:y@mm://t:0;fetchSize=2048;ApplicationName=JDBC;user=%2525user;jaasName=x;VirtualDatabaseName=y;kerberosServicePrincipleName=z", tds.buildURL().getJDBCURL()); }
public void helpTestBuildingURL2( final String vdbName, final String vdbVersion, final String serverName, final int portNumber, final String alternateServers, final String txnAutoWrap, final String partialMode, final int fetchSize, final boolean showPlan, final boolean secure, final boolean useJDBC4Semantics, final String expectedURL ) { final TeiidDataSource ds = new TeiidDataSource(); ds.setServerName(serverName); ds.setDatabaseVersion(vdbVersion); ds.setDatabaseName(vdbName); ds.setPortNumber(portNumber); ds.setFetchSize(fetchSize); ds.setAutoCommitTxn(txnAutoWrap); ds.setPartialResultsMode(partialMode); if(showPlan) { ds.setShowPlan(ShowPlan.ON.toString()); } ds.setSecure(secure); ds.setAlternateServers(alternateServers); ds.setUseJDBC4ColumnNameAndLabelSemantics(useJDBC4Semantics); String url; try { url = ds.buildURL().getJDBCURL(); } catch (TeiidSQLException e) { throw new RuntimeException(e); } compareUrls(expectedURL, url); }