当前位置: 首页>>代码示例>>Java>>正文


Java JoinRowSet.readXml方法代码示例

本文整理汇总了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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:JoinRowSetWebRowSetTest.java

示例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());
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:31,代码来源:JoinRowSetWebRowSetTest.java

示例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());
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:36,代码来源:JoinRowSetWebRowSetTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:JoinRowSetWebRowSetTest.java


注:本文中的javax.sql.rowset.JoinRowSet.readXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。