private void checkOSMTables ( Connection connection , boolean isH2 , TableLocation requestedTable , String osmTableName ) throws SQLException { String [ ] omsTables = new String [ ] { OSMTablesFactory . TAG , OSMTablesFactory . NODE , OSMTablesFactory . NODE_TAG , OSMTablesFactory . WAY , OSMTablesFactory . WAY_NODE , OSMTablesFactory . WAY_TAG , OSMTablesFactory . RELATION , OSMTablesFactory . RELATION_TAG , OSMTablesFactory . NODE_MEMBER , OSMTablesFactory . WAY_MEMBER , OSMTablesFactory . RELATION_MEMBER } ; for ( String omsTableSuffix : omsTables ) { String osmTable = TableUtilities . caseIdentifier ( requestedTable , osmTableName + omsTableSuffix , isH2 ) ; if ( JDBCUtilities . tableExists ( connection , osmTable ) ) { throw new SQLException ( "The table " + osmTable + " already exists." ) ; } } }
Check if one table already exists