Package javax.sql.rowset

Examples of javax.sql.rowset.FilteredRowSet.relative()


        rs = st.executeQuery("SELECT * FROM USER_INFO");
        filteredRowSet.populate(rs);

        assertTrue(filteredRowSet.absolute(3));
        assertEquals(3, filteredRowSet.getInt(1));
        assertFalse(filteredRowSet.relative(2));

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


        assertEquals(3, filteredRowSet.getInt(1));
        assertFalse(filteredRowSet.relative(2));

        assertTrue(filteredRowSet.absolute(3));
        assertEquals(3, filteredRowSet.getInt(1));
        assertTrue(filteredRowSet.relative(1));
        assertEquals(4, filteredRowSet.getInt(1));

        assertTrue(filteredRowSet.absolute(3));
        assertEquals(3, filteredRowSet.getInt(1));
        assertTrue(filteredRowSet.relative(-1));
View Full Code Here

        assertTrue(filteredRowSet.relative(1));
        assertEquals(4, filteredRowSet.getInt(1));

        assertTrue(filteredRowSet.absolute(3));
        assertEquals(3, filteredRowSet.getInt(1));
        assertTrue(filteredRowSet.relative(-1));
        assertEquals(2, filteredRowSet.getInt(1));
        assertFalse(filteredRowSet.relative(-2));

        RangeOne range = new RangeOne();
        filteredRowSet.setFilter(range);
View Full Code Here

        assertTrue(filteredRowSet.absolute(3));
        assertEquals(3, filteredRowSet.getInt(1));
        assertTrue(filteredRowSet.relative(-1));
        assertEquals(2, filteredRowSet.getInt(1));
        assertFalse(filteredRowSet.relative(-2));

        RangeOne range = new RangeOne();
        filteredRowSet.setFilter(range);

        filteredRowSet.beforeFirst();
View Full Code Here

        RangeOne range = new RangeOne();
        filteredRowSet.setFilter(range);

        filteredRowSet.beforeFirst();
        assertTrue(filteredRowSet.relative(2));
        assertEquals(3, filteredRowSet.getInt(1));
        assertEquals(3, filteredRowSet.getRow());
        assertFalse(filteredRowSet.relative(-2));
        assertTrue(filteredRowSet.isBeforeFirst());
    }
View Full Code Here

        filteredRowSet.beforeFirst();
        assertTrue(filteredRowSet.relative(2));
        assertEquals(3, filteredRowSet.getInt(1));
        assertEquals(3, filteredRowSet.getRow());
        assertFalse(filteredRowSet.relative(-2));
        assertTrue(filteredRowSet.isBeforeFirst());
    }

    public void testCursorMove() throws Exception {
        insertMoreData(30);
View Full Code Here

            assertTrue(filteredRowSet.absolute(1));
        } else {
            assertFalse(filteredRowSet.absolute(1));
        }
        assertEquals("hermit", filteredRowSet.getString(2));
        assertTrue(filteredRowSet.relative(1));
        assertEquals("test4", filteredRowSet.getString(2));
        /*
         * First call absolute(2), then call relative(-1), the cursor returns
         * the first row.
         */
 
View Full Code Here

         * First call absolute(2), then call relative(-1), the cursor returns
         * the first row.
         */
        assertTrue(filteredRowSet.absolute(2));
        assertEquals("test4", filteredRowSet.getString(2));
        assertTrue(filteredRowSet.relative(-1));
        assertEquals("hermit", filteredRowSet.getString(2));

        assertTrue(filteredRowSet.last());
        assertEquals("test34", filteredRowSet.getString(2));

View Full Code Here

        assertEquals("test34", filteredRowSet.getString(2));

        assertTrue(filteredRowSet.previous());
        assertEquals("test32", filteredRowSet.getString(2));

        assertTrue(filteredRowSet.relative(-1));
        assertEquals("test30", filteredRowSet.getString(2));

        assertTrue(filteredRowSet.absolute(5));
        assertEquals("test10", filteredRowSet.getString(2));
View Full Code Here

        assertEquals("test30", filteredRowSet.getString(2));

        assertTrue(filteredRowSet.absolute(5));
        assertEquals("test10", filteredRowSet.getString(2));

        assertTrue(filteredRowSet.relative(3));
        assertEquals("test16", filteredRowSet.getString(2));

        assertTrue(filteredRowSet.relative(-3));
        assertEquals("test10", filteredRowSet.getString(2));
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.