Forums

Home » Liferay Portal » magyarul »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Vilmos Kozma
country tábla magyarul
May 9, 2011 3:32 AM
Answer

Vilmos Kozma

Rank: Junior Member

Posts: 65

Join Date: November 12, 2009

Recent Posts

Sziasztok!

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

Üdv,
Vili
Vilmos Kozma
RE: country tábla magyarul
May 9, 2011 6:33 AM
Answer

Vilmos Kozma

Rank: Junior Member

Posts: 65

Join Date: November 12, 2009

Recent Posts

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 > 0) {
                    System.out.println(sourceCountry.getName() + " is updated.");
                }
            }
            System.out.println(updatedCount + " rows updated.");
        } catch (SQLException e) {
            System.out.println("Error: " + e);
        }


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

Üdv,
Vili