franta-hg@2: package cz.frantovo.abcDrupal; franta-hg@2: franta-hg@4: import java.sql.Connection; franta-hg@4: import java.sql.DriverManager; franta-hg@4: import java.sql.SQLException; franta-hg@2: import java.util.Date; franta-hg@2: franta-hg@2: /** franta-hg@2: * Řídící třída, stará se o konverzi z databáze Drupalu do databáze ABC. franta-hg@2: * @author fiki franta-hg@2: */ franta-hg@2: public class Konvertor { franta-hg@2: franta-hg@4: private PosluchacLogu posluchacLogu; franta-hg@2: private String jdbcZdroj; franta-hg@2: private String jdbcCil; franta-hg@4: private Connection dbZdroj; franta-hg@4: private Connection dbCil; franta-hg@2: franta-hg@2: public Konvertor(String jdbcZdroj, String jdbcCil, PosluchacLogu posluchacLogu) { franta-hg@2: this.jdbcZdroj = jdbcZdroj; franta-hg@2: this.jdbcCil = jdbcCil; franta-hg@2: this.posluchacLogu = posluchacLogu; franta-hg@2: } franta-hg@2: franta-hg@2: public void konvertuj() { franta-hg@2: vypis("Začíná migrace"); franta-hg@4: franta-hg@4: franta-hg@4: franta-hg@4: franta-hg@2: vypis("Migrace dokončena"); franta-hg@2: } franta-hg@4: franta-hg@4: private void nastavDBspojeni() throws SQLException { franta-hg@4: dbZdroj = DriverManager.getConnection(""); franta-hg@4: } franta-hg@4: franta-hg@2: franta-hg@2: private void vypis(String zprava) { franta-hg@2: if (posluchacLogu != null) { franta-hg@2: posluchacLogu.vypis(new Date() + " " + zprava); franta-hg@2: } franta-hg@2: } franta-hg@2: }