Package java.sql

Examples of java.sql.ResultSet.updateRow()


                                           ResultSet.CONCUR_UPDATABLE);
        s.setCursorName(getNextCursorName());
        ResultSet rs = s.executeQuery("select a,b from t1");
        rs.next();
        rs.updateInt(1, rs.getInt(1) + 2 * recordCount);
        rs.updateRow();
        assertTrue("Expected rowUpdated() to return true", rs.rowUpdated());
        rs.deleteRow();
        rs.next();
        rs.previous();
        assertTrue("Expected rowUpdated() to return true", rs.rowUpdated());
View Full Code Here


        rs.moveToInsertRow();
        checkDetectabilityCallsOutsideRow(rs, "on FO insertRow");

        rs.next();
        rs.updateInt(2, 666);
        rs.updateRow();
        checkDetectabilityCallsOutsideRow(rs, "after FO updateRow");

        rs.next();
        rs.deleteRow();
        checkDetectabilityCallsOutsideRow(rs, "after FO deleteRow");
View Full Code Here

                ps.executeUpdate();               
                fail("Expected exception to be thrown on positioned update " +
                     "since cursor is not positioned");
            } else {
                rs.updateInt(1, -1);
                rs.updateRow();
                fail("Expected exception to be thrown on updateRow() since " +
                     "cursor is not positioned");
            }
        } catch (SQLException e) {
            assertSQLState("Unexpected SQLState when updating row after commit",
View Full Code Here

        if (positioned) {
            ps.setInt(1, -1);
            ps.executeUpdate();               
        } else {
            rs.updateInt(1, -1);
            rs.updateRow();
        }
       
        s.close();
        ps.close();
       
View Full Code Here

        println("T1: Read first Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
        rs.updateInt(2, 3);
        println("T1: updateInt(2, 3);");
        rs.updateRow();
        println("T1: updateRow()");
        rs.last(); // Go to last tuple
        println("T1: Read last Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
View Full Code Here

        println("T1: Read last Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
        rs.updateInt(2, 3);
        println("T1: updateInt(2, 3);");
        rs.updateRow();
        println("T1: updateRow()");
        commit();
        println("T1: commit");
        rs = s.executeQuery("select * from t1");
        println("T3: select * from table");
View Full Code Here

        println("T1: read previous tuple");
        rs.previous(); // Go back to first tuple
        println("T1: id=" + rs.getInt(1));
        rs.updateInt(2, 3);
        println("T1: updateInt(2, 3);");
        rs.updateRow();
        println("T1: updated column 2, to value=3");
        println("T1: commit");
        commit();
        rs = s.executeQuery("select * from t1");
        while (rs.next()) {
View Full Code Here

                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
       
        println("T1: id=" + rs.getInt(1));
        rs.updateInt(2, 3);
        rs.updateRow();
        println("T1: updated column 2, to value=3");
        println("T1: commit");
        commit();
        rs = s.executeQuery("select * from t1");
        while (rs.next()) {
View Full Code Here

        rs.previous(); // Go back to first tuple
        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
        rs.updateInt(2, 3);
        rs.updateRow();
        println("T1: updated column 2, to value=3");
        commit();
        println("T1: commit");
        rs = s.executeQuery("select * from t1");
        while (rs.next()) {
View Full Code Here

        rs.previous(); // Go back to first tuple
        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
        rs.updateInt(3, 9999);
        rs.updateRow();
        println("T1: updated column 3, to value=9999");
        commit();
        println("T1: commit");
        rs = s.executeQuery("select * from t1");
        while (rs.next()) {
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.