本文整理汇总了Java中javax.sql.rowset.JoinRowSet.absolute方法的典型用法代码示例。如果您正苦于以下问题:Java JoinRowSet.absolute方法的具体用法?Java JoinRowSet.absolute怎么用?Java JoinRowSet.absolute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sql.rowset.JoinRowSet
的用法示例。
在下文中一共展示了JoinRowSet.absolute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
}
示例2: 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());
}
}