@Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { importFile(connection, tableReference, fileName, progress, null); }
@Override public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { exportTable(connection, tableReference, fileName, progress, null); }
@Override public void start(BundleContext bc) { for(Function function : H2GISFunctions.getBuiltInsFunctions()) { bc.registerService(Function.class, function, null); if(function instanceof DriverFunction) { bc.registerService(DriverFunction.class, (DriverFunction) function, null); } } //Driver registering bc.registerService(DriverFunction.class, new DBFDriverFunction(), null); bc.registerService(DriverFunction.class, new SHPDriverFunction(), null); bc.registerService(DriverFunction.class, new GPXDriverFunction(), null); bc.registerService(DriverFunction.class, new GeoJsonDriverFunction(), null); bc.registerService(DriverFunction.class, new OSMDriverFunction(), null); bc.registerService(DriverFunction.class, new KMLDriverFunction(), null); bc.registerService(DriverFunction.class, new CSVDriverFunction(), null); bc.registerService(DriverFunction.class, new TSVDriverFunction(), null); DataSourceTracker dataSourceTracker = new DataSourceTracker(bc); databaseTracker = new ServiceTracker<>(bc,DataSource.class,dataSourceTracker); databaseTracker.open(); }
@Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { importFile(connection, tableReference, fileName, progress, null); }
@Override public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { exportTable(connection, tableReference, fileName, progress, null); }
@Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { importFile(connection, tableReference, fileName, progress, null); }
@Override public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { exportTable(connection, tableReference, fileName, progress, null); }
@Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress, boolean deleteTables) throws SQLException, IOException { if(deleteTables) { final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData()); TableLocation requestedTable = TableLocation.parse(tableReference, isH2); String table = requestedTable.getTable(); Statement stmt = connection.createStatement(); stmt.execute("DROP TABLE IF EXISTS " + table); stmt.close(); } importFile(connection, tableReference, fileName, progress); } }