Package java.sql

Examples of java.sql.ResultSet.afterLast()


            assertFalse(rs.next());
            assertTrue(rs.isAfterLast());
            rs.beforeFirst();
            assertTrue(rs.next());
            assertEquals(1, rs.getInt(1));
            rs.afterLast();
            assertTrue(rs.previous());
            assertEquals(16, rs.getInt(1));
            assertTrue(rs.absolute(8));
            assertEquals(8, rs.getInt(1));
            assertTrue(rs.relative(-1));
View Full Code Here


    assertTrue(rs.next());
    rs.beforeFirst();
    checkPositioning(rs);

    rs.afterLast();
    checkPositioning(rs);

    rs.beforeFirst();
    assertTrue(rs.next());
    assertTrue(!rs.next());
View Full Code Here

    rs.beforeFirst();
    assertTrue(rs.next());
    assertTrue(!rs.next());
    checkPositioning(rs);

    rs.afterLast();
    assertTrue(rs.previous());
    assertTrue(!rs.previous());
    checkPositioning(rs);

    rs.close();
View Full Code Here

    }
    catch (SQLException e) {
      // Ok
    }
    try {
      rs.afterLast();
      fail("afterLast() on a TYPE_FORWARD_ONLY resultset did not throw an exception on a TYPE_FORWARD_ONLY resultset");
    }
    catch (SQLException e) {
      // Ok
    }
View Full Code Here

  @Test
  public void testBackward() throws SQLException {
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    ResultSet rs = stmt.executeQuery("SELECT * FROM testrs");
    rs.afterLast();
    assertTrue(rs.previous());
    rs.close();
    stmt.close();
  }

View Full Code Here

  @Test
  public void testEmptyResult() throws SQLException {
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    ResultSet rs = stmt.executeQuery("SELECT * FROM testrs where id=100");
    rs.beforeFirst();
    rs.afterLast();
    assertTrue(!rs.first());
    assertTrue(!rs.last());
    assertTrue(!rs.next());
  }

View Full Code Here

            statement.setString(1, filePath);
            rs = statement.executeQuery();

            rs.setFetchDirection(ResultSet.TYPE_SCROLL_INSENSITIVE);

            rs.afterLast();
            rs.previous();
            rtn = new Region[rs.getRow()];
            rs.beforeFirst();

            while (rs.next())
View Full Code Here

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

        }
        // Just navigate randomly.
        rs.previous();
        rs.absolute(2);
        rs.relative(2);
        rs.afterLast();
        rs.first();
        rs.next();
        rs.last();
        rs.beforeFirst();
        // Close the statement instead of the result set first.
View Full Code Here

        rs.first();
        rs.relative(3);
        rs.previous();
        rs.last();
        rs.absolute(5);
        rs.afterLast();
        rs.next();
    }

    /**
     * Tests that the cursor can be positioned on the current row multiple
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.