Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6324524

WebRowSet: readXML() behaviour

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • 5.0u3
    • core-libs
    • generic
    • generic

      Description of the method readXML() says "Reads a stream based XML input to populate this WebRowSet object". In the current implementaion of WebRowSet interface method readXL doen't replace content of the rowset, only add new rows added.
      But it would be logical if rowset content was replaced because XML data may have another metadata. The spec should updated to describe the method behaviour more clearly.

      Code example:

          public void xmlTest2(WebRowSet rs) throws SQLException, IOException {

              ByteArrayOutputStream out = new ByteArrayOutputStream();
              rs.writeXml(out);

              int size = rs.size();

              ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
              rs.readXml(in);

              if ( rs.size() != size )
                  System.out.println("Test failed!");
          }

            lancea Lance Andersen
            rmakarch Roman Makarchuk (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: