Examples of updateRow()


Examples of java.sql.ResultSet.updateRow()

                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

Examples of java.sql.ResultSet.updateRow()

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

Examples of java.sql.ResultSet.updateRow()

        rs.updateInt(2, newCol2);
        assertEquals("Expected the resultset to be updated after updateInt",
                     newCol2, rs.getInt(2));
        assertTrue("Expected rs.rowUpdated() to be false before updateRow",
                   !rs.rowUpdated());
        rs.updateRow();
       
        assertTrue("Expected rs.rowUpdated() to be true after updateRow",
                   rs.rowUpdated());
        assertEquals("Expected the resultset detect the updates of previous " +
                     "updateRow", newCol2, rs.getInt(2));
View Full Code Here

Examples of java.sql.ResultSet.updateRow()

        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));
        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" +
View Full Code Here

Examples of java.sql.ResultSet.updateRow()

        assertEquals("Expected the resultset to be updated after updateNull",
                     0, rs.getInt(2));
        assertTrue("Expected wasNull to be true after updateNull", rs.wasNull());
        assertTrue("Expected rs.rowUpdated() to be false before updateRow",
                   !rs.rowUpdated());
        rs.updateRow();
       
        assertTrue("Expected rs.rowUpdated() to be true after updateRow",
                   rs.rowUpdated());
        assertEquals("Expected the resultset detect the updates of previous " +
                     "updateRow", 0, rs.getInt(2));
View Full Code Here

Examples of java.sql.ResultSet.updateRow()

        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", 0, rs.getInt(2));
        rs.updateNull(3);
        rs.updateRow();
        assertEquals("Expected the resultset to be updated after updateNull",
                     0, rs.getInt(3));
        rs.cancelRowUpdates();
       
        assertEquals("Expected the resultset detect the updates of previous" +
View Full Code Here

Examples of java.sql.ResultSet.updateRow()

       
        try {
            rs.moveToInsertRow();
            rs.updateInt(1, currentPosition + 2000);
            rs.updateRow();
        } catch (SQLException se) {
            assertEquals("Expected exception",
                    se.getSQLState().substring(0, 5),
                    INVALID_CURSOR_STATE_NO_CURRENT_ROW);
        }
View Full Code Here

Examples of java.sql.ResultSet.updateRow()

            // Update the key of every second row.
            int key = rs.getInt(1);
            if (key%2==0) {
                int newKey = -key;
                rs.updateInt(1, newKey);
                rs.updateRow();
            }
        }
        PreparedStatement ps = prepareStatement
            ("select * from t1 where id=?");
        for (int i=0; i<recordCount; i++) {
View Full Code Here

Examples of java.sql.ResultSet.updateRow()

        assertEquals("Expected one row to be updated", 1,
                     ps.executeUpdate());
       
        rs.updateInt(2, -555);
        rs.updateInt(3, -777);
        rs.updateRow();
       
        PreparedStatement ps2 = prepareStatement
            ("select * from t1 where id=?");
        ps2.setInt(1, -primaryKey);
        ResultSet rs2 = ps2.executeQuery();
View Full Code Here

Examples of java.sql.ResultSet.updateRow()

        assertEquals("Expected one row to be updated", 1,
                     ps.executeUpdate());
        rs.updateInt(1, primaryKey*10);
        rs.updateInt(2, -555);
        rs.updateInt(3, -777);
        rs.updateRow();
       
        PreparedStatement ps2 =
            prepareStatement("select * from t1 where id=?");
        ps2.setInt(1, primaryKey*10);
        ResultSet rs2 = ps2.executeQuery();
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.