Package javax.sql.rowset

Examples of javax.sql.rowset.JdbcRowSet.moveToCurrentRow()


        jrs.moveToInsertRow();
        jrs.updateInt(1, 6);
        jrs.updateString(2, "insert6");
        jrs.insertRow();
        jrs.moveToCurrentRow();

        assertTrue(jrs.last());
        assertEquals(6, jrs.getInt(1));
        assertTrue(jrs.previous());
        assertEquals(5, jrs.getInt(1));
View Full Code Here


        jrs.updateString(2, "insert6");
        jrs.insertRow();
        jrs.updateInt(1, 7);
        jrs.updateString(2, "insert7");
        jrs.insertRow();
        jrs.moveToCurrentRow();

        int index = 0;
        jrs.beforeFirst();
        while (jrs.next()) {
            index++;
View Full Code Here

        jrs.insertRow();
        jrs.moveToInsertRow();
        jrs.updateInt(1, 10);
        jrs.updateString(2, "insert10");
        jrs.insertRow();
        jrs.moveToCurrentRow();

        /*
         * Check JdbcRowSet
         */
        assertEquals(7, jrs.getInt(1));
View Full Code Here

            jrs.cancelRowUpdates();
            fail("should throw SQLException");
        } catch (SQLException e) {
            // expected
        }
        jrs.moveToCurrentRow();

        assertTrue(jrs.absolute(3));
        jrs.updateString(2, "update3");
        jrs.updateRow();
        assertTrue(jrs.rowUpdated());
View Full Code Here

        } catch (SQLException e) {
            // expected
        }
        jrs.isReadOnly();
        try {
            jrs.moveToCurrentRow();
            fail("should throw SQLException");
        } catch (SQLException e) {
            // expected
        }
        try {
View Full Code Here

        // Inserts a new row.
        jrs.moveToInsertRow();
        jrs.updateInt(1, 5);
        jrs.updateString(2, "test5");
        jrs.insertRow();
        jrs.moveToCurrentRow();

        // Tests if jrs has the same behaviour with connection when commit in
        // auto-commit mode.
        boolean hasCommitException = true;
View Full Code Here

        // Inserts a row.
        jrs.moveToInsertRow();
        jrs.updateInt(1, 6);
        jrs.updateString(2, "test6");
        jrs.insertRow();
        jrs.moveToCurrentRow();
        assertTrue(jrs.absolute(6));
        assertEquals(6, jrs.getInt(1));

        // Commits
        jrs.commit();
View Full Code Here

        // Inserts a new row.
        jrs.moveToInsertRow();
        jrs.updateInt(1, 5);
        jrs.updateString(2, "test5");
        jrs.insertRow();
        jrs.moveToCurrentRow();

        assertTrue(jrs.absolute(5));
        assertEquals(5, jrs.getInt(1));

        // Set autoCommit to false.
View Full Code Here

        // Inserts a row.
        jrs.moveToInsertRow();
        jrs.updateInt(1, 6);
        jrs.updateString(2, "test6");
        jrs.insertRow();
        jrs.moveToCurrentRow();
        assertTrue(jrs.absolute(6));
        assertEquals(6, jrs.getInt(1));

        // Rollbacks
        jrs.rollback();
View Full Code Here

        jrs.moveToInsertRow();
        jrs.updateInt(1, 5);
        jrs.updateString(2, "insert5");
        jrs.insertRow();
        jrs.moveToCurrentRow();

        // check the inserted row
        assertTrue(jrs.absolute(5));
        /*
         * If uncommenting the following line, then the inserted row which ID is
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.