Regalamiunsorriso/decompiled-libs/www/acxent-common-1.0.1/AggDocFiglio.java

50 lines
1.6 KiB
Java

import it.acxent.contab.Documento;
import it.acxent.db.ApplParm;
import it.acxent.db.ApplParmFull;
import it.acxent.util.DbConsole;
import it.acxent.util.Vectumerator;
public class AggDocFiglio extends DbConsole {
public static void main(String[] args) {
AggDocFiglio bean = new AggDocFiglio();
bean.doImport();
System.exit(0);
}
public void doImport() {
String db = "guidoreni";
int i = 0;
int se1 = 10;
int se2 = 100;
String hostname = "localhost";
String temp = getCi().readLine("Hostname (" + hostname + "):");
if (!temp.isEmpty())
hostname = temp;
temp = getCi().readLine("Database name (" + db + "):");
if (!temp.isEmpty())
db = temp;
System.out.println("Db: " + db);
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
apTarget.setDebug(false);
StringBuffer msg = new StringBuffer();
try {
System.out.println("calcolo tot record....");
Vectumerator vec = new Documento(apTarget).findAll();
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
int updRec = 0;
while (vec.hasMoreElements()) {
Documento row = (Documento)vec.nextElement();
if (row.getId_documentoFiglio() != 0L)
updRec++;
i++;
if (se1 > 0 && i % se1 == 0)
System.out.print(".");
if (se2 > 0 && i % se2 == 0)
System.out.println("" + i + " " + i);
}
System.out.println("--- fine ---");
} catch (Exception e) {
e.printStackTrace();
}
}
}