Package javax.sql.rowset

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


            fail("Should throw SQLException " + "since no current row.");
        } catch (SQLException e) {
            // Expected.
        }

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


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

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

            fail("Should throw SQLException");
        } catch (SQLException e) {
            // expected, Invalid state
        }
        try {
            jrs.first();
            fail("Should throw SQLException");
        } catch (SQLException e) {
            // expected, Invalid state
        }
        try {
View Full Code Here

        jrs.execute();

        jrs.beforeFirst();
        assertTrue(jrs.isBeforeFirst());
        assertTrue(jrs.next());
        assertTrue(jrs.first());
        assertFalse(jrs.previous());
        assertTrue(jrs.isBeforeFirst());
        assertTrue(jrs.absolute(1));
        assertTrue(jrs.first());
        assertEquals(1, jrs.getInt(1));
View Full Code Here

        assertTrue(jrs.next());
        assertTrue(jrs.first());
        assertFalse(jrs.previous());
        assertTrue(jrs.isBeforeFirst());
        assertTrue(jrs.absolute(1));
        assertTrue(jrs.first());
        assertEquals(1, jrs.getInt(1));

        assertTrue(jrs.relative(3));
        assertEquals(4, jrs.getInt(1));
        assertTrue(jrs.previous());
View Full Code Here

        assertTrue(jrs.relative(3));
        assertEquals(4, jrs.getInt(1));
        assertTrue(jrs.previous());
        assertEquals(3, jrs.getInt(1));
        assertTrue(jrs.relative(-2));
        assertTrue(jrs.first());

        assertTrue(jrs.absolute(10));
        assertEquals(10, jrs.getInt(1));
        assertTrue(jrs.last());
        assertFalse(jrs.next());
View Full Code Here

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

        assertEquals(6, jrs.getInt(1));

        // Rollbacks
        jrs.rollback();
        try {
            jrs.first();
            fail("After rolling back, jrs can't do anything except close.");
        } catch (NullPointerException e) {
            // Expected.
        }
View Full Code Here

        jrs = newJdbcRowSet();
        jrs.setUrl(DERBY_URL);
        jrs.setCommand("SELECT * FROM USER_INFO WHERE ID >= ?");
        jrs.setInt(1, 2);
        jrs.execute();
        assertTrue(jrs.first());
        assertEquals(2, jrs.getInt(1));

        // change the query condition
        jrs.setInt(1, 3);
        jrs.execute();
View Full Code Here

        assertEquals(2, jrs.getInt(1));

        // change the query condition
        jrs.setInt(1, 3);
        jrs.execute();
        assertTrue(jrs.first());
        assertEquals(3, jrs.getInt(1));

        // change the command
        jrs.setCommand("SELECT * FROM USER_INFO WHERE NAME = 'hermit'");
        jrs.execute();
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.