Package javax.sql.rowset

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


        jrs.setUrl(DERBY_URL);
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.execute();

        // Deletes the 4th row.
        jrs.absolute(4);
        jrs.deleteRow();
        try {
            jrs.getInt(1);
            fail("Should throw SQLException " + "since no current row.");
        } catch (SQLException e) {
View Full Code Here


        assertEquals(3, index);

        jrs.setShowDeleted(true);
        assertTrue(jrs.getShowDeleted());

        jrs.absolute(3);
        jrs.deleteRow();
        jrs.first();
        index = 0;
        while (jrs.next()) {
            index++;
View Full Code Here

        jrs = newJdbcRowSet();
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.setUrl(DERBY_URL);
        jrs.execute();

        assertTrue(jrs.absolute(7));
        jrs.moveToInsertRow();
        jrs.updateInt(1, 8);
        jrs.updateString(2, "insert8");
        jrs.insertRow();
        jrs.moveToInsertRow();
View Full Code Here

        } catch (SQLException e) {
            // expected
        }
        jrs.moveToCurrentRow();

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

        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.setUrl(DERBY_URL);
        jrs.execute();

        assertTrue(jrs.getAutoCommit());
        assertTrue(jrs.absolute(3));
        jrs.updateString(2, "update3");
        jrs.updateRow();
        jrs.rollback();

        // after rollback, resultset is closed
View Full Code Here

        } catch (NullPointerException e) {
            // expected
        }

        try {
            jrs.absolute(1);
            fail("should throw exception");
        } catch (NullPointerException e) {
            // expected
        }
View Full Code Here

        jrs.setUrl(DERBY_URL);
        jrs.execute();

        jrs.setAutoCommit(false);
        assertFalse(jrs.getAutoCommit());
        assertTrue(jrs.absolute(3));
        jrs.updateString(2, "update3");
        jrs.updateRow();
        jrs.commit();
        jrs.rollback();
View Full Code Here

        /*
         * TODO why throw NullPointerException after call rollback()?
         */
        try {
            jrs.absolute(1);
            fail("should throw exception");
        } catch (NullPointerException e) {
            // expected
        }

View Full Code Here

    }

    public void testConstructor() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();
        try {
            jrs.absolute(3);
            fail("should throw SQLException");
        } catch (SQLException e) {
            // expected
        }
        jrs.addRowSetListener(new Listener());
View Full Code Here

    public void testBeforeInitial() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();

        // move cursor
        try {
            jrs.absolute(1);
            fail("Should throw SQLException");
        } catch (SQLException e) {
            // expected, Invalid state
        }
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.