예제 #1
0
  private void write(Writer os, Object rowValue, ArrayList encodedCols, String col)
      throws SQLException, IOException {
    try {
      if (!encodedCols.contains(col.toUpperCase())) {
        os.write(rowValue.toString());
        //            os.write("<![CDATA[" + rowValue.toString() + "]]>");
      } else {
        //              os.write("<![CDATA[" +
        //                       EncoderDecoder.escapeUnicodeString1(rowValue.toString(), true) +
        //                       "]]>");

        os.write(EncoderDecoder.escapeUnicodeString1(rowValue.toString(), true));
      }
    } catch (NullPointerException ex) {
      os.write("NULL");
    }
  }
예제 #2
0
  /**
   * writes a long values in XML file
   *
   * @param os
   * @param rs
   * @param index
   * @throws IOException
   * @throws SQLException
   */
  public void write(Writer os, ResultSet rs, int index, ArrayList encodedCols, String col)
      throws SQLException, IOException {
    try {
      if (!encodedCols.contains(col.toUpperCase())) {
        os.write(getObject(rs, index).toString());
        //            os.write("<![CDATA[" + getObject(rs, index).toString() + "]]>");
      } else {
        os.write(EncoderDecoder.escapeUnicodeString1(getObject(rs, index).toString(), true));

        //              os.write("<![CDATA[" +
        //                       EncoderDecoder.escapeUnicodeString1(getObject(rs, index).
        //                  toString(), true) +
        //                       "]]>");
      }

    } catch (NullPointerException ex) {
      os.write("NULL");
    }
  }