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

@param xmlPath path to XML BeST files
@param reg best region
@throws ClassNotFoundException
@throws SQLException
Load XML BeST data files for a specific region in a database file . @param xmlPath path to XML BeST files @param reg best region @throws ClassNotFoundException @throws SQLException
private void loadDataRegion(Path xmlPath, BestRegion reg) throws SQLException {
		LOG.log(Level.INFO, "Loading data for region {}", reg);
		try(Connection conn = getConnection()) {
			PreparedStatement prep = conn.prepareStatement(
				"INSERT INTO PostalInfo(identifier, postalCode, nameNL, nameFR, nameDE) " +
				" VALUES (?, ?, ?, ?, ?)");
			loadPostals(prep, xmlPath, reg);
			prep = conn.prepareStatement(
				"INSERT INTO Municipality(identifier, refnisCode, nameNL, nameFR, nameDE) " +
				" VALUES (?, ?, ?, ?, ?)");
			loadMunicipalities(prep, xmlPath, reg);
			prep = conn.prepareStatement(
				"INSERT INTO PartOfMunicipality(identifier, nameNL, nameFR, nameDE) " +
				" VALUES (?, ?, ?, ?)");
			loadMunicipalityParts(prep, xmlPath, reg);
			prep = conn.prepareStatement(
				"INSERT INTO Street(identifier, mIdentifier, nameNL, nameFR, nameDE, " +
					" status, validFrom, validTo, beginLifeSpanVersion, endLifeSpanVersion ) " +
				" VALUES (?, ?, ?, ?, ?, " + 
						" ?, ?, ?, ?, ?)");
			loadStreets(prep, xmlPath, reg);
			prep = conn.prepareStatement(
				"INSERT INTO Address(identifier, mIdentifier, mpIdentifier, sIdentifier, pIdentifier, " +
					" housenumber, boxnumber, status, validFrom, " +
					" validTo, beginLifespanVersion, endLifespanVersion, point, firstAddress) " +
				" VALUES (?, ?, ?, ?, ?, " +
						" ?, ?, ?, ?, " +
						" ?, ?, ?, ?, ?)");
			loadAddresses(prep, xmlPath, reg);
		}
	}
private void loadDataRegion ( Path xmlPath , BestRegion reg ) throws SQLException { LOG . log ( Level . INFO , "Loading data for region {}" , reg ) ; try ( Connection conn = getConnection ( ) ) { PreparedStatement prep = conn . prepareStatement ( "INSERT INTO PostalInfo(identifier, postalCode, nameNL, nameFR, nameDE) " + " VALUES (?, ?, ?, ?, ?)" ) ; loadPostals ( prep , xmlPath , reg ) ; prep = conn . prepareStatement ( "INSERT INTO Municipality(identifier, refnisCode, nameNL, nameFR, nameDE) " + " VALUES (?, ?, ?, ?, ?)" ) ; loadMunicipalities ( prep , xmlPath , reg ) ; prep = conn . prepareStatement ( "INSERT INTO PartOfMunicipality(identifier, nameNL, nameFR, nameDE) " + " VALUES (?, ?, ?, ?)" ) ; loadMunicipalityParts ( prep , xmlPath , reg ) ; prep = conn . prepareStatement ( "INSERT INTO Street(identifier, mIdentifier, nameNL, nameFR, nameDE, " + " status, validFrom, validTo, beginLifeSpanVersion, endLifeSpanVersion ) " + " VALUES (?, ?, ?, ?, ?, " + " ?, ?, ?, ?, ?)" ) ; loadStreets ( prep , xmlPath , reg ) ; prep = conn . prepareStatement ( "INSERT INTO Address(identifier, mIdentifier, mpIdentifier, sIdentifier, pIdentifier, " + " housenumber, boxnumber, status, validFrom, " + " validTo, beginLifespanVersion, endLifespanVersion, point, firstAddress) " + " VALUES (?, ?, ?, ?, ?, " + " ?, ?, ?, ?, " + " ?, ?, ?, ?, ?)" ) ; loadAddresses ( prep , xmlPath , reg ) ; } }
Load XML BeST data files for a specific region in a database file.
Load XML BeST data files for a specific region in a database file .