@Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String options) throws SQLException, IOException { importFile(connection, tableReference, fileName, progress); }
@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); } }
/** * Read the GeoJSON file. * * @param connection * @param fileName * @param tableReference * @throws IOException * @throws SQLException */ public static void readGeoJson(Connection connection, String fileName, String tableReference) throws IOException, SQLException { GeoJsonDriverFunction gjdf = new GeoJsonDriverFunction(); gjdf.importFile(connection, tableReference, URIUtilities.fileFromString(fileName), new EmptyProgressVisitor()); } }
/** * Read the GeoJSON file. * * @param connection * @param fileName * @param tableReference * @throws IOException * @throws SQLException */ public static void readGeoJson(Connection connection, String fileName, String tableReference) throws IOException, SQLException { GeoJsonDriverFunction gjdf = new GeoJsonDriverFunction(); gjdf.importFile(connection, tableReference, URIUtilities.fileFromString(fileName), new EmptyProgressVisitor()); } }
/** * Read the GeoJSON file. * * @param connection * @param fileName * @param tableReference * @throws IOException * @throws SQLException */ public static void readGeoJson(Connection connection, String fileName, String tableReference) throws IOException, SQLException { GeoJsonDriverFunction gjdf = new GeoJsonDriverFunction(); gjdf.importFile(connection, tableReference, URIUtilities.fileFromString(fileName), new EmptyProgressVisitor()); } }