Fórum

country tábla magyarul

Vilmos Kozma, modificado 12 Anos atrás.

country tábla magyarul

Junior Member Postagens: 68 Data de Entrada: 12/11/09 Postagens Recentes
Sziasztok!

Nincs meg véletlenül valakinek a country tábla magyarított változatban?

Üdv,
Vili
Vilmos Kozma, modificado 12 Anos atrás.

RE: country tábla magyarul (Resposta)

Junior Member Postagens: 68 Data de Entrada: 12/11/09 Postagens Recentes
Közben megoldottam (ha valakit esetleg érdekel).

Letöltöttem innen egy mysql dumpot:
http://webdraft.eu/orszagok_varosok/geoinfo.sql

És írtam egy feldolgozó progit:


		try {
			Connection sourceCon = DBMan.getConnection(Constants.SOURCE_URL, Constants.SOURCE_DRIVER, Constants.SOURCE_USER, Constants.SOURCE_PASS);
			Connection targetCon = DBMan.getConnection(Constants.LIFERAY_URL, Constants.LIFERAY_DRIVER, Constants.LIFERAY_USER, Constants.LIFERAY_PASS);
			if (sourceCon == null || targetCon == null) {
				System.out.println("Unable to get connection for source table or for Liferay table.");
				System.exit(-1);
			}
			List<sourcecountry> sourceCountries = DBMan.loadList(sourceCon, "select * from wsh_co_country", SourceCountry.class);
			int updatedCount = 0;
			for (SourceCountry sourceCountry : sourceCountries) {
				int updated = DBMan.update(targetCon, "update country set name=? where a2=?", sourceCountry.getName(), sourceCountry.getCountryCode());
				updatedCount += updated;
				if (updated &gt; 0) {
					System.out.println(sourceCountry.getName() + " is updated.");
				}
			}
			System.out.println(updatedCount + " rows updated.");
		} catch (SQLException e) {
			System.out.println("Error: " + e);
		}
</sourcecountry>


Amatőr de működik és nekem megfelelt.

Üdv,
Vili