public static void dropOSMTables ( Connection connection , boolean isH2 , String tablePrefix ) throws SQLException { TableLocation requestedTable = TableLocation . parse ( tablePrefix , isH2 ) ; String osmTableName = requestedTable . getTable ( ) ; String [ ] omsTables = new String [ ] { TAG , NODE , NODE_TAG , WAY , WAY_NODE , WAY_TAG , RELATION , RELATION_TAG , NODE_MEMBER , WAY_MEMBER , RELATION_MEMBER } ; StringBuilder sb = new StringBuilder ( "drop table if exists " ) ; String omsTableSuffix = omsTables [ 0 ] ; String osmTable = TableUtilities . caseIdentifier ( requestedTable , osmTableName + omsTableSuffix , isH2 ) ; sb . append ( osmTable ) ; for ( int i = 1 ; i < omsTables . length ; i ++ ) { omsTableSuffix = omsTables [ i ] ; osmTable = TableUtilities . caseIdentifier ( requestedTable , osmTableName + omsTableSuffix , isH2 ) ; sb . append ( "," ) . append ( osmTable ) ; } try ( Statement stmt = connection . createStatement ( ) ) { stmt . execute ( sb . toString ( ) ) ; } }
Drop the existing OSM tables used to store the imported OSM data