TableLoader oTblLdr = new TableLoader(sTableName);
oTblLdr.prepare(getConnection(),oColList);
String[] aColumns = oTblLdr.columnNames();
CSVParser oCsvPrsr = new CSVParser(sEncoding);
oCsvPrsr.parseFile(sFilePath, Gadgets.join(aColumns,"\t"));
final int nLines = oCsvPrsr.getLineCount();
final int nCols = oCsvPrsr.getColumnCount();
getConnection().setAutoCommit(false);
for (int l=0; l<nLines; l++) {
c = -1;
try {
while (++c<nCols) {
f = oCsvPrsr.getField(c,l);
oTblLdr.put(c, f);
} // wend
oTblLdr.store(getConnection(), "", iFlags);
oTblLdr.setAllColumnsToNull();
getConnection().commit();
} catch (Exception xcpt) {
iErrors++;
String sTrc = "";
try { sTrc = com.knowgate.debug.StackTraceUtil.getStackTrace(xcpt); } catch (IOException ignore) {}
if (null!=oStrLog) oStrLog.append(xcpt.getClass().getName()+" for value "+f+" at line " + String.valueOf(l+1) + " column "+String.valueOf(c+1)+" of type "+oColList.getColumn(c).getSqlTypeName()+": " + xcpt.getMessage() + "\t" + oCsvPrsr.getLine(l) + "\n" + sTrc);
getConnection().rollback();
oTblLdr.setAllColumnsToNull();
break;
}
} // next