本文整理汇总了Java中javax.sql.rowset.JoinRowSet.readXml方法的典型用法代码示例。如果您正苦于以下问题:Java JoinRowSet.readXml方法的具体用法?Java JoinRowSet.readXml怎么用?Java JoinRowSet.readXml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sql.rowset.JoinRowSet
的用法示例。
在下文中一共展示了JoinRowSet.readXml方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testReadXml_Empty
import javax.sql.rowset.JoinRowSet; //导入方法依赖的package包/类
public void testReadXml_Empty() throws Exception {
jrs = newJoinRowSet();
jrs.addRowSet(crset, 1);
StringWriter writer = new StringWriter();
jrs.writeXml(writer);
JoinRowSet another = newJoinRowSet();
another.readXml(new StringReader(writer.getBuffer().toString()));
assertCachedRowSetEquals(jrs, another);
}
示例2: testWriteAndRead_Insert
import javax.sql.rowset.JoinRowSet; //导入方法依赖的package包/类
public void testWriteAndRead_Insert() throws Exception {
jrs.addRowSet(crset, 1);
jrs.beforeFirst();
assertTrue(jrs.next());
jrs.moveToInsertRow();
jrs.updateInt(1, 5);
jrs.updateString(2, "insertrow");
jrs.insertRow();
jrs.moveToCurrentRow();
jrs.beforeFirst();
jrs.absolute(2);
assertTrue(jrs.rowInserted());
StringWriter writer = new StringWriter();
jrs.writeXml(writer);
JoinRowSet another = newJoinRowSet();
another.readXml(new StringReader(writer.getBuffer().toString()));
if (System.getProperty("Testing Harmony") == "true") {
assertCachedRowSetEquals(jrs, another);
} else {
// TODO why the output xml has no insert information.
another.absolute(2);
assertFalse(another.rowInserted());
jrs.absolute(2);
assertTrue(jrs.rowInserted());
}
}
示例3: testWriteAndRead_Update
import javax.sql.rowset.JoinRowSet; //导入方法依赖的package包/类
public void testWriteAndRead_Update() throws Exception {
jrs.addRowSet(crset, 1);
jrs.beforeFirst();
assertTrue(jrs.absolute(3));
jrs.updateString(2, "updateRow");
jrs.updateRow();
assertTrue(jrs.next());
jrs.updateString(2, "anotherUpdateRow");
jrs.updateRow();
StringWriter writer = new StringWriter();
jrs.writeXml(writer);
JoinRowSet another = newJoinRowSet();
another.readXml(new StringReader(writer.getBuffer().toString()));
if (System.getProperty("Testing Harmony") == "true") {
assertCachedRowSetEquals(jrs, another);
} else {
another.absolute(3);
assertFalse(another.rowUpdated());
jrs.absolute(3);
assertTrue(jrs.rowUpdated());
// TODO why the output xml has no update information.
another.absolute(4);
assertFalse(another.rowUpdated());
jrs.absolute(4);
assertTrue(jrs.rowUpdated());
}
}
示例4: testWriteXmlLResultSet
import javax.sql.rowset.JoinRowSet; //导入方法依赖的package包/类
public void testWriteXmlLResultSet() throws Exception {
StringWriter writer = new StringWriter();
rs = st.executeQuery("select * from user_info");
jrs.writeXml(rs, writer);
JoinRowSet jrs2 = newJoinRowSet();
jrs2.readXml(new StringReader(writer.getBuffer().toString()));
assertCachedRowSetEquals(crset, jrs2);
}