Package java.sql

Examples of java.sql.ResultSet.previous()


        passed = false;
        break;
      }
    }
    // We should not see another row (only 5, not 6)
    if (rs.previous())
    {
      System.out.println("rs.previous() failed, should not have seen 6th row.");
      passed = false;
    }
    rs.close();
View Full Code Here


    }
    rs.afterLast();
    // Iterate backwards thru RS, expect only 5 rows.
    for (int index = 1; index < 6; index++)
    {
      if (! rs.previous())
      {
        System.out.println("rs.previous() failed, index = " + index);
        passed = false;
        break;
      }
View Full Code Here

        passed = false;
        break;
      }
    }
    // We should not see another row (only 5, not 6)
    if (rs.previous())
    {
      System.out.println("rs.previous() failed, should not have seen 6th row.");
      passed = false;
    }
    rs.close();
View Full Code Here

    if (rs.next())
    {
      System.out.println("rs.next() expected to show result set is empty");
      passed = false;
    }
    if (rs.previous())
    {
      System.out.println("rs.previous() expected to show result set is empty");
      passed = false;
    }
    if (rs.isAfterLast())
View Full Code Here

                // Start from afterLast and verify maxRows
                rs.afterLast();
                // Iterate backwards thru RS, expect only (maxRows - 1) rows.
                for (int index = 1; index < maxRows + 1; index++)
                {
                        if (! rs.previous())
                        {
                                System.out.println("rs.previous() failed, index = " +
                                        index);
                                passed = false;
                                break;
View Full Code Here

                                            " not: " + rs.getInt(1));
                                }
                        }
                }
                // We should not see another row (only maxRows, not total)
                if (rs.previous())
                {
                        System.out.println("Error with maxRows = " + maxRows +
                                " and fetchSize = " + fetchSize + "\n" +
                                "rs.previous() failed, should not have seen " +
                                (maxRows + 1) + "th row.");
View Full Code Here

                        passed = false;
                }
                // Iterate backwards thru RS, expect only (maxRows - 1) more rows.
                for (int index = 1; index < maxRows; index++)
                {
                        if (! rs.previous())
                        {
                                System.out.println("rs.previous() failed, index = " +
                                        index);
                                passed = false;
                                break;
View Full Code Here

                                            rs.getInt(1));
                                }
                        }
                }
                // We should not see another row (only 5, not 6)
                if (rs.previous())
                {
                        System.out.println("Error with maxRows = " + maxRows +
                                " and fetchSize = " + fetchSize + "\n" +
                                "rs.previous() failed, should not have seen " +
                                (maxRows + 1) + "th row.");
View Full Code Here

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

        currentPosition = rs.getRow();
        rs.moveToInsertRow();
        rs.updateInt(1, currentPosition + 1000);
        rs.afterLast();
        assertTrue("isAfterLast() should return true", rs.isAfterLast());
        rs.previous();
        assertEquals("CurrentPosition should be " + lastRow,
                rs.getRow(), lastRow);
        assertTrue("isLast() should return true", rs.isLast());

        // Test that it is possible to insert a row and move back to current row
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.