Package java.sql

Examples of java.sql.ResultSet.beforeFirst()


                        }

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


            s.executeQuery("select * from t1");
       
        rs.last();
        lastRow = rs.getRow();
       
        rs.beforeFirst();
       
        rs.next();
       
        // Test that it is possible to move to next row from insertRow
        currentPosition = rs.getRow();
View Full Code Here

        // Test that it is possible to move beforeFirst from insertRow
        currentPosition = rs.getRow();
        rs.moveToInsertRow();
        rs.updateInt(1, currentPosition + 1000);
        rs.beforeFirst();
        assertTrue("isBeforeFirst() should return true", rs.isBeforeFirst());
        rs.next();
        assertEquals("CurrentPosition should be 1", rs.getRow(), 1);
        assertTrue("isFirst() should return true", rs.isFirst());
View Full Code Here

        rs.next();
        rs.moveToInsertRow();
        checkDetectabilityCallsOutsideRow(rs, "on insertRow");
        rs.moveToCurrentRow(); // needed until to DERBY-1322 is fixed

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

        rs.afterLast();
        checkDetectabilityCallsOutsideRow(rs, "on afterLast row");
View Full Code Here

        rs.relative(1);
        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.beforeFirst();
            fail("beforeFirst() on a TYPE_FORWARD_ONLY resultset did not throw an exception");
        }
        catch (SQLException e)
        {
        }
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

      rs = sql.retrieve(query, param);
      rs.last();
      int rows = rs.getRow();
      int cols = rs.getMetaData().getColumnCount();
      result = new SimpleTable(rows,cols);
      rs.beforeFirst();

      for (int i=0;i<cols;i++){
        String title = rs.getMetaData().getColumnLabel(i+1);
        String name = rs.getMetaData().getColumnName(i+1);
        String classname = rs.getMetaData().getColumnClassName(i+1);
View Full Code Here

            break;
          }
        }
        if (isFound) {
          if (rs.isLast()) {
            rs.beforeFirst();
            LOGGER.logp(Level.FINE, CLASS_NAME, METHOD, "Doc ID#" + unid +
                " is at the end of collection; reset to first record");
          } else {
            rs.previous();
            LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
View Full Code Here

          }
        } else {
          LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
              "Document unique id was not found in " + indexedTableName +
              " table");
          rs.beforeFirst();
        }
      }
      int count = 0;
      while (rs.next() && count < batchSize) {
        NotesDocId notesId = new NotesDocId();
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.