Package ru.vassaev.core.db

Examples of ru.vassaev.core.db.IDataHelper


    try {
      con = Manager.getConnection(conName);
      PreparedStatement st = qr.getStatement(con);
      ResultSet rs = st.executeQuery();

      IDataHelper dh = DataHelper.getInstance(dataClass);

      Properties props = getStepProperties();
      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);
View Full Code Here

TOP

Related Classes of ru.vassaev.core.db.IDataHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.