first commit
This commit is contained in:
commit
4d332ef662
27586 changed files with 3281783 additions and 0 deletions
50
rus/WEB-INF/lib/abliaDbCom_src/SaveDocumento.java
Normal file
50
rus/WEB-INF/lib/abliaDbCom_src/SaveDocumento.java
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import com.ablia.contab.Documento;
|
||||
import com.ablia.contab.DocumentoCR;
|
||||
import com.ablia.db.ApplParm;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.util.DbConsole;
|
||||
import com.ablia.util.Vectumerator;
|
||||
|
||||
public class SaveDocumento extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SaveDocumento bean = new SaveDocumento();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "tf19";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "www.tuttofoto.com";
|
||||
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 {
|
||||
DocumentoCR CR = new DocumentoCR();
|
||||
CR.setId_tipoDocumento(21L);
|
||||
Vectumerator<Documento> vec = new Documento(apTarget).findByCR(CR, 0, 0);
|
||||
System.out.println("TOT RECORD: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Documento row = (Documento)vec.nextElement();
|
||||
row.save();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.println("\n\n ------------- Fine ----------------");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue