Examples of updateInt()


Examples of java.sql.ResultSet.updateInt()

        }
        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.updateInt()

        final int oldCol2 = rs.getInt(2);
        final int newCol2 = -2222;
        final int oldCol3 = rs.getInt(3);
        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));
View Full Code Here

Examples of java.sql.ResultSet.updateInt()

        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));
        assertTrue("Expected rs.rowUpdated() to be false before updateRow",
                   !rs.rowUpdated());
        rs.updateRow();
View Full Code Here

Examples of java.sql.ResultSet.updateInt()

        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));
       
        rs.updateInt(3, newCol3);
       
        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));
View Full Code Here

Examples of java.sql.ResultSet.updateInt()

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

Examples of java.sql.ResultSet.updateInt()

        // Test that it is possible to insert a row and move back to current row
        rs.previous();
        currentPosition = rs.getRow();
        rs.moveToInsertRow();
        rs.updateInt(1, currentPosition + 1000);
        rs.insertRow();
        rs.moveToCurrentRow();
        assertEquals("CurrentPosition should be " + currentPosition,
                rs.getRow(), currentPosition);
View Full Code Here

Examples of java.sql.ResultSet.updateInt()

                rs.getRow(), currentPosition);

       
        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.updateInt()

                    INVALID_CURSOR_STATE_NO_CURRENT_ROW);
        }
       
        try {
            rs.moveToInsertRow();
            rs.updateInt(1, currentPosition + 2000);
            rs.deleteRow();
        } 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.updateInt()

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

Examples of java.sql.ResultSet.updateInt()

        while(rs.previous()) {
            // 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=?");
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.