2 Replies Latest reply on May 1, 2012 2:10 PM by 850455

    Traverse all rows of database for migration script

      I am trying to write a custom migration script in java and I simply want to retrieve all rows from the database. I would think this would be simple but it is not working as I expected. I am trying to do it with a cursor looping while cursor.getNext is not null. This throws me in an infinite loop and doesn't seem to be stepping to the next record at all. code snippet

      Cursor cursor = db.openCursor(null, null);
      DatabaseEntry data = new DatabaseEntry();
      DatabaseEntry key = new DatabaseEntry();

      while(cursor.getNext(key, data, null) != null){
           TupleInput returnData = TupleBinding.entryToInput(data);
           log.info("row: " + returnData.readString());