-
Enhancement
-
Resolution: Unresolved
-
P5
-
None
-
5.0u3
-
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!");
}
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!");
}