String charset = props.getProperty("charset");
String fileName = props.getProperty("file");
File fl = new File(fileName);
if (!createNewFile(fl))
throw new SysException("Cannot create file");
FileOutputStream fls = new FileOutputStream(fl.getCanonicalPath());
IRowFormat rf1 = rf;
if (rf1 == null)
rf1 = new DSVRowFormat();
int i = 0;
Object o = rowClass.newInstance();
while (rs.next()) {
dh.loadFromRs(tp_src, rs, o);
ctm.addRowAt(o, 0);
String s = rf1.format(ctm, 0);
fls.write(s.getBytes(charset));
fls.write("\r\n".getBytes(charset));
ctm.delRowAt(0);
i++;
}
rs.close();
fls.close();
} catch (java.sql.SQLException ex) {
throw new SysException(ex);
} catch (IllegalAccessException ex) {
throw new SysException(ex);
} catch (InstantiationException ex) {
throw new SysException(ex);
} catch (IOException ex) {
throw new SysException(ex);
} finally {
Manager.freeConnection(con);
if (qr != null)
qr.close();
}