Class TxtExport


  • public class TxtExport
    extends Object
    • Constructor Detail

      • TxtExport

        public TxtExport()
    • Method Detail

      • writeTXT

        public static void writeTXT​(ResultSet resultSet,
                                    Writer writer,
                                    DataRow baseDR,
                                    boolean useLabel)
                             throws Exception
        Uses the given Writer object to write the ResultSet's content as plain text to the output stream.

        Example Usage with an FileWriter object:
         ResultSet rs = new ResultSet();
         
         DataRow dr = new DataRow();
         dr.setFieldValue("feld1", "TEST1");
         dr.setFieldValue("feld2", "TEST2");
         rs.add(dr);
         
         dr = new DataRow();
         dr.setFieldValue("feld1", "TEST1");
         dr.setFieldValue("feld3", "TEST3");
         rs.add(dr);
         
         FileWriter fw = new FileWriter("D:/test.txt");
         ResultSetExporter.writeTXT(rs, fw);
         fw.flush();
         fw.close();
         
        Parameters:
        resultSet - The ResultSet to export.
        writer - A java.io.Writer Instance.
        Throws:
        Exception