@Override protected String getDatabaseID() { return delegate.getDatabaseID(); }
protected final boolean checkDBType(Map params, String dbtype) { String type; try { type = (String) DBTYPE.lookUp(params); if (dbtype.equals(type)) { return true; } return false; } catch (IOException e) { return false; } }
DBTYPE.description, DBTYPE.required, getDatabaseID())); parameters.put(HOST.key, HOST); parameters.put(PORT.key, PORT);
/** * Builds up the JDBC url in a jdbc:<database>://<host>:<port>/<dbname> Override if you need a * different setup * * @param params * @return * @throws IOException */ protected String getJDBCUrl(Map params) throws IOException { // jdbc url String host = (String) HOST.lookUp(params); Integer port = (Integer) PORT.lookUp(params); String db = (String) DATABASE.lookUp(params); String url = "jdbc:" + getDatabaseID() + "://" + host; if (port != null) { url += ":" + port; } if (db != null) { url += "/" + db; } return url; }
@Override protected String getFixtureId() { return createTestSetup().createDataStoreFactory().getDatabaseID(); }
public void testJNDIDataSource() throws Exception { ((JDBCJNDITestSetup) setup).setupJNDIEnvironment(getDataStoreFactory()); HashMap params = new HashMap(); String dbtype = setup.createDataStoreFactory().getDatabaseID(); params.put(JDBCDataStoreFactory.NAMESPACE.key, "http://www.geotools.org/test"); params.put(JDBCDataStoreFactory.DBTYPE.key, dbtype); params.put(JDBCJNDIDataStoreFactory.JNDI_REFNAME.key, "ds"); JDBCDataStore dataStore = null; try { dataStore = (JDBCDataStore) DataStoreFinder.getDataStore(params); try (Connection con = dataStore.getDataSource().getConnection()) { assertTrue(con != null); assertFalse(con.isClosed()); } } finally { if (dataStore != null) { dataStore.dispose(); } } }
@Override protected String getDatabaseID() { return delegate.getDatabaseID(); }
protected final boolean checkDBType(Map params, String dbtype) { String type; try { type = (String) DBTYPE.lookUp(params); if (dbtype.equals(type)) { return true; } return false; } catch (IOException e) { return false; } }
public boolean canProcess(Map params) { if (!super.canProcess(params)) { return false; // was not in agreement with getParametersInfo } String type; try { type = (String) DBTYPE.lookUp(params); if (getDatabaseID().equals(type)) { return true; } return false; } catch (IOException e) { return false; } }
new Param(DBTYPE.key, DBTYPE.type, DBTYPE.description, DBTYPE.required, getDatabaseID())); parameters.put(HOST.key, HOST); parameters.put(PORT.key, PORT);
new Param(DBTYPE.key, DBTYPE.type, DBTYPE.description, DBTYPE.required, getDatabaseID())); parameters.put(HOST.key, HOST); parameters.put(PORT.key, PORT);
/** * Builds up the JDBC url in a jdbc:<database>://<host>:<port>/<dbname> * Override if you need a different setup * @param params * @return * @throws IOException */ protected String getJDBCUrl(Map params) throws IOException { // jdbc url String host = (String) HOST.lookUp(params); Integer port = (Integer) PORT.lookUp(params); String db = (String) DATABASE.lookUp(params); String url = "jdbc:" + getDatabaseID() + "://" + host; if ( port != null ) { url += ":" + port; } if ( db != null ) { url += "/" + db; } return url; } }
/** * Builds up the JDBC url in a jdbc:<database>://<host>:<port>/<dbname> * Override if you need a different setup * @param params * @return * @throws IOException */ protected String getJDBCUrl(Map params) throws IOException { // jdbc url String host = (String) HOST.lookUp(params); Integer port = (Integer) PORT.lookUp(params); String db = (String) DATABASE.lookUp(params); String url = "jdbc:" + getDatabaseID() + "://" + host; if ( port != null ) { url += ":" + port; } if ( db != null ) { url += "/" + db; } return url; } }