Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4929845

Rave: Pointbase throws a SQLException if an attempt is made to move the cursor a

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P1 P1
    • None
    • 1.0
    • core-libs
    • other
    • windows_2000

      Hi Jonathan and Val,

      Unfortunately, I found a showstopper pointbase bug: Pointbase throws a SQLException if an attempt is made to move the cursor after an updateRow(). That is, once we call update row, we can't move the cursor to the next
      row.

      Code to reproduce (does not use rowset to remove rowset as a possible cause of the problem):

      try {
      // pointbase issue
      Connection c = < code to get a Pointbase embedded server connection>
      PreparedStatement pst = c.prepareStatement(
      "select personid, name, jobtitle from person",
      ResultSet.TYPE_SCROLL_INSENSITIVE,
      ResultSet.CONCUR_UPDATABLE);
      ResultSet res = pst.executeQuery();
      System.out.println("res.next() returns: " + res.next());
      res.updateString("name", "McNealy, Scott");
      res.updateRow();
      System.out.println("this next() will throw an exception");
      System.out.println("res.next() returns: " + res.next());
      res.close();
      pst.close();
      c.close();
      } catch (SQLException e) {
      System.out.println(e);
      }

      Output from above code:

      res.next() returns: true
      this next() will throw an exception
      java.sql.SQLException: Result set is in an invalid state. May be before the first row or
      after the last row.

      Notes:

      - The above code throws an exception whether or not another row exists in the result set.

      - Removing the updateString and/or updateRow eliminates the exception (i.e., if updateRow is not called
      or there is nothing to update, the cursor can be advanced to the next row)

      - The above code works if the connection is to Oracle.

      I think this should be easy for pointbase to reproduce. If they can't reproduce it, I'll send them code to create and
      populate the "Travel" database we are testing against.

      - John
      ###@###.### 2003-09-29
      ###@###.### 2004-05-14

            lancea Lance Andersen
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: