Examples of relative()


Examples of java.sql.ResultSet.relative()

                rs.last();
                int rows = rs.getRow();
               
                rs.absolute(rows/2);
                if (rs.relative(-1 * (rows))) {
                    System.out.println("relative(" + -1 * (rows) + ") should return false, position outside of the resultSet");
                   
                }
                if (!rs.isBeforeFirst()) {
                    System.out.println("isBeforeFirst should be true");
View Full Code Here

Examples of java.sql.ResultSet.relative()

                if (!rs.isBeforeFirst()) {
                    System.out.println("isBeforeFirst should be true");
                }

                rs.absolute(rows/2);
                if (rs.relative(rows)) {
                    System.out.println("relative(" + (rows) + ") should return false, position outside of the resultSet");
                }
                if (!rs.isAfterLast()) {
                    System.out.println("isAfterLast should be true");
                }
View Full Code Here

Examples of java.sql.ResultSet.relative()

                            System.out.println(sqle.getMessage());
                        }
    }
    try
    {
      rs.relative(1);
      // Should never get here
      System.out.println("relative() expected to fail");
      passed = false;
    }
    catch (SQLException sqle)
View Full Code Here

Examples of java.sql.ResultSet.relative()

       
        rs.clearWarnings();
        rs.deleteRow();
        warn = rs.getWarnings();
        assertWarning(warn, CURSOR_OPERATION_CONFLICT);
        rs.relative(0);
        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));
       
        rs.close();
View Full Code Here

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

Examples of java.sql.ResultSet.relative()

       
        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

Examples of java.sql.ResultSet.relative()

        // 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

Examples of java.sql.ResultSet.relative()

       
        // Check that we after a repositioning can update:
        if (resultSetType==ResultSet.TYPE_FORWARD_ONLY) {
            rs.next();
        } else {
            rs.relative(0);
        }
        if (positioned) {
            ps.setInt(1, -1);
            ps.executeUpdate();               
        } else {
View Full Code Here

Examples of java.sql.ResultSet.relative()

       
        // 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

Examples of java.sql.ResultSet.relative()

        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
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.