Package java.sql

Examples of java.sql.ResultSet.afterLast()


            if (!error) {
                throw e;
            }
        }
        try {
            rs.afterLast();
            assertState(rs, false, false, false, rows > 0);
        } catch (SQLException e) {
            if (!error) {
                throw e;
            }
View Full Code Here


    rs.close();


    // Empty result set tests (DERBY-992)
    rs = s_i_r.executeQuery("select * from t where 1=0");
    rs.afterLast();
    if (rs.isAfterLast()) {
      System.out.println("afterLast() on empty RS should be no-op");
    }
   
    rs.beforeFirst();
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

                                (maxRows + 1) + "th row.");
                        passed = false;
                }

                // 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())
                        {
View Full Code Here

        // Test that it is possible to move afterLast from insertRow
        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());
View Full Code Here

        rs.moveToCurrentRow(); // needed until to DERBY-1322 is fixed

        rs.beforeFirst();
        checkDetectabilityCallsOutsideRow(rs, "on beforeFirst row");

        rs.afterLast();
        checkDetectabilityCallsOutsideRow(rs, "on afterLast row");

        rs.first();
        rs.deleteRow();
        checkDetectabilityCallsOutsideRow(rs, "after deleteRow");
View Full Code Here

        rs.absolute(3);
        rs.relative(-1);
        rs.first();
        rs.last();
        rs.beforeFirst();
        rs.afterLast();
       
        // close result set and statement
        rs.close();
        s.close();
    }
View Full Code Here

        catch (SQLException e)
        {
        }
        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)
        {
        }
View Full Code Here

    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

    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

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.