Package java.sql

Examples of java.sql.ResultSet.relative()


        assertFalse(rs.previous());
        assertFalse(rs.isAfterLast());
        assertFalse(rs.isFirst());
        assertFalse(rs.isLast());
        assertFalse(rs.relative(0));
        assertFalse(rs.relative(1));
        assertFalse(rs.relative(-1));
        assertFalse(rs.absolute(0));
        assertFalse(rs.absolute(1));
        assertFalse(rs.absolute(-1));
        rs.close();
View Full Code Here


        assertFalse(rs.isAfterLast());
        assertFalse(rs.isFirst());
        assertFalse(rs.isLast());
        assertFalse(rs.relative(0));
        assertFalse(rs.relative(1));
        assertFalse(rs.relative(-1));
        assertFalse(rs.absolute(0));
        assertFalse(rs.absolute(1));
        assertFalse(rs.absolute(-1));
        rs.close();
        // End of empty result set tests
View Full Code Here

        assertFalse(rs.previous());
        rs.last();
        int rows = rs.getRow();

        rs.absolute(rows / 2);
        assertFalse(rs.relative(-1 * (rows)));
        assertTrue(rs.isBeforeFirst());

        rs.absolute(rows / 2);
        assertFalse(rs.relative(rows));
        assertTrue(rs.isAfterLast());
View Full Code Here

        rs.absolute(rows / 2);
        assertFalse(rs.relative(-1 * (rows)));
        assertTrue(rs.isBeforeFirst());

        rs.absolute(rows / 2);
        assertFalse(rs.relative(rows));
        assertTrue(rs.isAfterLast());
        rs.absolute(rows / 2);
        assertFalse("absolute(" + (rows + 1)
                + ") should return false, position outside of the resultSet",
                rs.absolute(rows + 1));
View Full Code Here

        } catch (SQLException sqle) {
            assertOnlyOnScrollableException(sqle);

        }
        try {
            rs.relative(1);
            // Should never get here
            fail("relative() expected to fail");
        } catch (SQLException sqle) {
            assertOnlyOnScrollableException(sqle);
        }
View Full Code Here

       
        final int newVal = rs.getInt(1) + 11;
        final int newSize = rs.getInt(2) / 2;
        testUpdateBlobWithPositionedUpdate(rs, newVal, newSize);

        rs.relative(0); // Necessary after a positioned update
       
        println("Verify updated blob using result set");
        verifyBlob(newVal, newSize, rs.getBlob(3));
       
        rs.close();
View Full Code Here

       
        final int newVal = BLOBDataModelSetup.bigVal * 2;
        final int newSize = BLOBDataModelSetup.bigSize / 2;
        testUpdateBlobWithPositionedUpdate(rs, newVal, newSize);

        rs.relative(0); // Necessary after a positioned update
       
        println("Verify updated blob using result set");
        verifyBlob(newVal, newSize, rs.getBlob("DATA"));
       
        rs.close();
View Full Code Here

                        numGrabbed = 0;
                    }

                    // now move the cursor to the correct position
                    if (pageNum != 1) {
                        rs.relative(startNum - 1);
                    }

                    // grab the rest
                    while (rs.next() && numGrabbed < pageSize) {
                        String productId = rs.getString("product_id");
View Full Code Here

                            numGrabbed = 0;
                        }

                        // now move the cursor to the correct position
                        if(pageNum != 1){
                            rs.relative(startNum-1);
                        }

                        // grab the rest
                        while (rs.next() && numGrabbed < pageSize) {
                            String productId = rs.getString("product_id");
View Full Code Here

           rs = ps_c1.executeQuery();
           rs.first();
           assertEquals(2,rs.getInt(1));
           assertEquals(1,rs.getRow());
          
           rs.relative(11);
           assertEquals(13, rs.getInt(1));
           assertEquals(12, rs.getRow());
          
           rs.relative(1);
           assertNoCurrentRow(rs);
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.