java/dbloader/src/main/java/be/bosa/dt/best/dbloader/PostGisLoader.java
/**
	 * Load XML BeST data files in a database.
	 * 
	 * @param xmlPath path to XML BeST files
	 * @throws ClassNotFoundException
	 * @throws SQLException 
	 */
Load XML BeST data files in a database.

@param xmlPath path to XML BeST files
@throws ClassNotFoundException
@throws SQLException
Load XML BeST data files in a database . @param xmlPath path to XML BeST files @throws ClassNotFoundException @throws SQLException
public void loadData(Path xmlPath) throws ClassNotFoundException, SQLException {
		dropTables();
		dropEnums();
		createEnums();
		createTables();
		addConstraints();
		List<Runnable> tasks = new ArrayList<>();
		for (BestRegion reg: REGIONS){
			tasks.add(() -> {
				try {
					loadDataRegion(xmlPath, reg);
				} catch (SQLException ex) {
					LOG.log(Level.SEVERE, "Loading for region failed", ex);
				}
			});
		}
		tasks.stream().parallel().forEach(Runnable::run);
		createIndex();
		setFirstAddress();
	}
public void loadData ( Path xmlPath ) throws ClassNotFoundException , SQLException { dropTables ( ) ; dropEnums ( ) ; createEnums ( ) ; createTables ( ) ; addConstraints ( ) ; List < Runnable > tasks = new ArrayList < > ( ) ; for ( BestRegion reg : REGIONS ) { tasks . add ( ( ) -> { try { loadDataRegion ( xmlPath , reg ) ; } catch ( SQLException ex ) { LOG . log ( Level . SEVERE , "Loading for region failed" , ex ) ; } } ) ; } tasks . stream ( ) . parallel ( ) . forEach ( Runnable :: run ) ; createIndex ( ) ; setFirstAddress ( ) ; }
Load XML BeST data files in a database.
Load XML BeST data files in a database .
//addPostalTables();