Package java.sql

Examples of java.sql.ResultSet.relative()


        Statement s3 = createStatement();
        int updateCount = s3.executeUpdate
            ("update t1 set A=" + newValue +
             " where current of " + rs.getCursorName());
       
        rs.relative(0);
        SQLWarning warn = s3.getWarnings();
        assertWarning(warn, CURSOR_OPERATION_CONFLICT);
        assertTrue("Expected rs.rowUpdated() to be false", !rs.rowUpdated());
        assertTrue("Expected rs.rowDeleted() to be false", !rs.rowDeleted());
        assertEquals("Did not expect the resultset to be updated", oldValue, rs.getInt(2));
View Full Code Here


       
        Statement s4 = createStatement();
        updateCount = s4.executeUpdate("delete from t1 where current of " +
                                       rs.getCursorName());
       
        rs.relative(0);
        warn = s4.getWarnings();
        assertWarning(warn, CURSOR_OPERATION_CONFLICT);
        assertTrue("Expected rs.rowUpdated() to be false", !rs.rowUpdated());
        assertTrue("Expected rs.rowDeleted() to be false", !rs.rowDeleted());
        assertEquals("Did not expect the resultset to be updated", oldValue, rs.getInt(2));
View Full Code Here

        // Test that it is possible to move using relative from insertRow
        currentPosition = rs.getRow();
        rs.moveToInsertRow();
        rs.updateInt(1, currentPosition + 1000);
        rs.relative(2);
        assertEquals("CurrentPosition should be " + (currentPosition + 2),
                rs.getRow(), currentPosition + 2);
        // should be able to delete the row
        rs.deleteRow();
View Full Code Here

       
        // call positioning methods
        rs.next();
        rs.next();
        rs.previous();
        rs.relative(1);
        rs.absolute(3);
        rs.relative(-1);
        rs.first();
        rs.last();
        rs.beforeFirst();
View Full Code Here

        rs.next();
        rs.next();
        rs.previous();
        rs.relative(1);
        rs.absolute(3);
        rs.relative(-1);
        rs.first();
        rs.last();
        rs.beforeFirst();
        rs.afterLast();
       
View Full Code Here

                assertSQLState("XJ061",se);
            else
                assertSQLState("XJ125",se);
        }
        try {
            rs.relative(1);
            fail("relative() not allowed on forward only result set");
        } catch(SQLException se) {
            if (usingEmbedded())
                assertSQLState("XJ061",se);
            else
View Full Code Here

            rs.absolute(0);
            assertNoCurrentRow(rs);
            rs.close();
           
            rs = ps_c1.executeQuery();
            rs.relative(0);
            assertNoCurrentRow(rs);
            rs.close();
            rs = ps_c1.executeQuery();
           
            rs.relative(2);
View Full Code Here

            rs.relative(0);
            assertNoCurrentRow(rs);
            rs.close();
            rs = ps_c1.executeQuery();
           
            rs.relative(2);
            assertEquals("c",rs.getString(1).trim());
            assertEquals(3, rs.getInt(2));
            rs.close();
            rs = ps_c1.executeQuery();
            rs.first();
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

          
           rs.relative(11);
           assertEquals(13, rs.getInt(1));
           assertEquals(12, rs.getRow());
          
           rs.relative(1);
           assertNoCurrentRow(rs);
           rs.last();
           assertEquals(13, rs.getInt(1));
           assertEquals(12,rs.getRow());
          
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.