Examples of cancelRowUpdates()


Examples of java.sql.ResultSet.cancelRowUpdates()

    public void testCancelRowUpdatesOnReadOnlyRS() throws SQLException {
        createTableT1();
        Statement stmt = createStatement();
        ResultSet rs = stmt.executeQuery("SELECT * FROM t1");
        try {
            rs.cancelRowUpdates();
            fail("FAIL - should not have reached here because " +
                    "cancelRowUpdates is being called on a " +
                    "read-only resultset");
        } catch (SQLException e) {
            assertSQLState("XJ083", e);
View Full Code Here

Examples of java.sql.ResultSet.cancelRowUpdates()

        }
       
        // calling cancelRowUpdates will fail because the result set is not
        // positioned
        try {
            rs.cancelRowUpdates();
            fail("FAIL - cancelRowUpdates should have failed because the " +
                    "resultset is not positioned on a row");
        }catch (SQLException e) {
            String sqlState = usingEmbedded() ? "24000" : "XJ121";
            assertSQLState(sqlState, e);
View Full Code Here

Examples of java.sql.ResultSet.cancelRowUpdates()

        }
       
        // Position the ResultSet with next()
        assertTrue("FAIL - statement should return a row", rs.next());
        // Should be able to cancelRowUpdates() on the current row now"
        rs.cancelRowUpdates();
        rs.close();
        pStmt.close();
       
        // Verify that the data was correctly updated
        String[][] expected = {{"5", "aa"}, {"2", "bb"}, {"3", "cc"}};
View Full Code Here

Examples of java.sql.ResultSet.cancelRowUpdates()

                1, rs.getInt(1));
        rs.updateInt(1,234);
        assertEquals("FAIL - wrong value for column 1 before updateInt",
                234, rs.getInt(1));
        println("now cancelRowUpdates on the row");
        rs.cancelRowUpdates();
        assertEquals("FAIL - wrong value for column 1 after cancelRowUpdates",
                1, rs.getInt(1));
        rs.deleteRow();
       
        // calling updateRow after deleteRow w/o first positioning the ResultSet
View Full Code Here

Examples of java.sql.ResultSet.cancelRowUpdates()

        createTableT1();
        Statement stmt = createStatement(
                ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
        ResultSet rs = stmt.executeQuery("SELECT * FROM t1");
        assertTrue("FAIL - row not found", rs.next());
        rs.cancelRowUpdates();
        rs.close();
        stmt.close();
    }
   
    /**
 
View Full Code Here

Examples of java.sql.ResultSet.cancelRowUpdates()

    assertEquals(1, rs.getInt(1));
    assertEquals("anyvalue", rs.getString(2));

    // update, cancel and make sure nothings changed.
    rs.updateInt(1, 99);
    rs.cancelRowUpdates();
    assertEquals(1, rs.getInt(1));
    assertEquals("anyvalue", rs.getString(2));

    // real update
    rs.updateInt(1, 999);
View Full Code Here

Examples of java.sql.ResultSet.cancelRowUpdates()

    ResultSet rs = st.executeQuery("select * from updateable");
    assertNotNull(rs);
    rs.moveToInsertRow();

    try {
      rs.cancelRowUpdates();
      fail("expected an exception when calling cancelRowUpdates() on the insert row");
    }
    catch (SQLException e) {
      // Expected...
    }
View Full Code Here

Examples of java.sql.ResultSet.cancelRowUpdates()

        final int newCol3 = -3333;
               
        rs.updateInt(2, newCol2);
        assertEquals("Expected the resultset to be updated after updateInt",
                     newCol2, rs.getInt(2));
        rs.cancelRowUpdates();
        assertEquals("Expected updateXXX to have no effect after cancelRowUpdated",
                     oldCol2, rs.getInt(2));
        rs.updateInt(2, newCol2);
        assertEquals("Expected the resultset to be updated after updateInt",
                     newCol2, rs.getInt(2));
View Full Code Here

Examples of java.sql.ResultSet.cancelRowUpdates()

        assertEquals("Expected the resultset to be updated after updateInt",
                     newCol3, rs.getInt(3));
        assertEquals("Expected the resultset detect the updates of previous " +
                     "updateRow", newCol2, rs.getInt(2));
       
        rs.cancelRowUpdates();
       
        assertEquals("Expected updateXXX to have no effect after " +
                     "cancelRowUpdated", oldCol3, rs.getInt(3));
        assertEquals("Expected the resultset detect the updates of previous " +
                     "updateRow after cancelRowUpdated", newCol2, rs.getInt(2));
View Full Code Here

Examples of java.sql.ResultSet.cancelRowUpdates()

                     "updateRow after cancelRowUpdated", newCol2, rs.getInt(2));
        rs.updateInt(3, newCol3);
        rs.updateRow();
        assertEquals("Expected the resultset to be updated after updateInt",
                     newCol3, rs.getInt(3));
        rs.cancelRowUpdates();
       
        assertEquals("Expected the resultset detect the updates of previous" +
                     "updateRow after cancelRowUpdates", newCol2, rs.getInt(2));
        assertEquals("Expected the resultset detect the updates of previous" +
                     "updateRow after cancelRowUpdates", newCol3, rs.getInt(3));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.