Oracle Fusion Middleware Java API Reference for Oracle TopLink (Deprecated)
11g Release 1 (11.1.1)

B32476-04

oracle.toplink.queryframework
Class ScrollableCursor

java.lang.Object
  extended by oracle.toplink.queryframework.Cursor
      extended by oracle.toplink.queryframework.ScrollableCursor
All Implemented Interfaces:
java.io.Serializable, java.util.Enumeration, java.util.Iterator, java.util.ListIterator

public class ScrollableCursor
extends Cursor
implements java.util.ListIterator

See Also:
Serialized Form

Field Summary
 
Fields inherited from class oracle.toplink.queryframework.Cursor
policy
 
Method Summary
 boolean absolute(int rows)
          Moves the cursor to the given row number in the result set
 void add(java.lang.Object object)
          Add is not support for scrollable cursors.
 void afterLast()
          Moves the cursor to the end of the result set, just after the last row.
 void beforeFirst()
          Moves the cursor to the front of the result set, just before the first row
 int currentIndex()
          Retrieves the current row index number
 boolean first()
          Moves the cursor to the first row in the result set
 int getPosition()
          Retrieves the current cursor positon (current row).
 boolean hasMoreElements()
          Indicates whether the cursor can move to the the next row
 boolean hasNext()
          Indicates whether the cursor can move to the the next row
 boolean hasNextElement()
          Indicates whether the cursor can move to the the next row
 boolean hasPrevious()
          Indicates whether the cursor can move to the the previous row
 boolean isAfterLast()
          Indicates whether the cursor is after the last row in the result set.
 boolean isBeforeFirst()
          Indicates whether the cursor is before the first row in the result set.
 boolean isFirst()
          Indicates whether the cursor is on the first row of the result set.
 boolean isLast()
          Indicates whether the cursor is on the last row of the result set.
 boolean last()
          Moves the cursor to the last row in the result set
 java.lang.Object next()
          This method differs slightly from conventinal read() operation on a Java stream.
 java.util.Vector next(int number)
          This method differs slightly from conventinal read() operation on a Java stream.
 java.lang.Object nextElement()
          Return the next object from the collection, if beyond the read limit read from the cursor.
 int nextIndex()
          Retrieves the next row index (against the current row)
 java.lang.Object previous()
          Return the previous object from the collection.
 int previousIndex()
          Retrieves the previous row index (against the current row)
 boolean relative(int rows)
          Moves the cursor a relative number of rows, either positive or negative.
 void remove()
          Remove is not support with scrollable cursors.
 void set(java.lang.Object object)
          Set is not supported for scrollable cursors.
 
Methods inherited from class oracle.toplink.queryframework.Cursor
close, isClosed, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

absolute

public boolean absolute(int rows)
                 throws DatabaseException
Moves the cursor to the given row number in the result set

Throws:
DatabaseException

add

public void add(java.lang.Object object)
         throws QueryException
Add is not support for scrollable cursors.

Specified by:
add in interface java.util.ListIterator
Throws:
QueryException

afterLast

public void afterLast()
               throws DatabaseException
Moves the cursor to the end of the result set, just after the last row.

Throws:
DatabaseException

beforeFirst

public void beforeFirst()
                 throws DatabaseException
Moves the cursor to the front of the result set, just before the first row

Throws:
DatabaseException

currentIndex

public int currentIndex()
                 throws DatabaseException
Retrieves the current row index number

Throws:
DatabaseException

first

public boolean first()
              throws DatabaseException
Moves the cursor to the first row in the result set

Throws:
DatabaseException

getPosition

public int getPosition()
                throws DatabaseException
Retrieves the current cursor positon (current row). The first row is number 1, the second number 2, and so on. Unlike java.sql.ResultSet.getRow(), 0 is not returned if afterLast. Instead size() + 1 is returned.

Specified by:
getPosition in class Cursor
Returns:
the current row number; 0 if there is no current row
Throws:
java.sql.SQLException - if a database access error occurs
DatabaseException

hasMoreElements

public boolean hasMoreElements()
                        throws DatabaseException
Indicates whether the cursor can move to the the next row

Specified by:
hasMoreElements in interface java.util.Enumeration
Throws:
DatabaseException

hasNext

public boolean hasNext()
                throws DatabaseException
Indicates whether the cursor can move to the the next row

Specified by:
hasNext in interface java.util.Iterator
Specified by:
hasNext in interface java.util.ListIterator
Throws:
DatabaseException

hasNextElement

public boolean hasNextElement()
                       throws DatabaseException
Indicates whether the cursor can move to the the next row

Throws:
DatabaseException

hasPrevious

public boolean hasPrevious()
                    throws DatabaseException
Indicates whether the cursor can move to the the previous row

Specified by:
hasPrevious in interface java.util.ListIterator
Throws:
DatabaseException

isAfterLast

public boolean isAfterLast()
                    throws DatabaseException
Indicates whether the cursor is after the last row in the result set.

Throws:
DatabaseException

isBeforeFirst

public boolean isBeforeFirst()
                      throws DatabaseException
Indicates whether the cursor is before the first row in the result set.

Throws:
DatabaseException

isFirst

public boolean isFirst()
                throws DatabaseException
Indicates whether the cursor is on the first row of the result set.

Throws:
DatabaseException

isLast

public boolean isLast()
               throws DatabaseException
Indicates whether the cursor is on the last row of the result set.

Throws:
DatabaseException

last

public boolean last()
             throws DatabaseException
Moves the cursor to the last row in the result set

Throws:
DatabaseException

next

public java.lang.Object next()
                      throws DatabaseException,
                             QueryException
This method differs slightly from conventinal read() operation on a Java stream. This method return the next object in the collection rather than specifying the number of bytes to be read in. Return the next object from the collection, if beyond the read limit read from the cursor

Specified by:
next in interface java.util.Iterator
Specified by:
next in interface java.util.ListIterator
Returns:
- next object in stream
Throws:
- - throws exception if read pass end of stream
DatabaseException
QueryException

next

public java.util.Vector next(int number)
                      throws DatabaseException
This method differs slightly from conventinal read() operation on a Java stream. This method returns the next number of objects in the collection in a vector. Return the next specified number of objects from the collection, if beyond the read limit read from the cursor

Parameters:
number - - number of objects to be returned
Returns:
- vector containing next number of objects
Throws:
- - throws exception if read pass end of stream
DatabaseException

nextElement

public java.lang.Object nextElement()
                             throws DatabaseException,
                                    QueryException
Return the next object from the collection, if beyond the read limit read from the cursor.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
next object in stream
Throws:
DatabaseException
QueryException

nextIndex

public int nextIndex()
              throws DatabaseException
Retrieves the next row index (against the current row)

Specified by:
nextIndex in interface java.util.ListIterator
Throws:
DatabaseException

previous

public java.lang.Object previous()
                          throws DatabaseException,
                                 QueryException
Return the previous object from the collection.

Specified by:
previous in interface java.util.ListIterator
Returns:
- previous object in stream
Throws:
- - throws exception if read pass first of stream
DatabaseException
QueryException

previousIndex

public int previousIndex()
                  throws DatabaseException
Retrieves the previous row index (against the current row)

Specified by:
previousIndex in interface java.util.ListIterator
Throws:
DatabaseException

relative

public boolean relative(int rows)
                 throws DatabaseException
Moves the cursor a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row

Throws:
DatabaseException

remove

public void remove()
            throws QueryException
Remove is not support with scrollable cursors.

Specified by:
remove in interface java.util.Iterator
Specified by:
remove in interface java.util.ListIterator
Throws:
QueryException

set

public void set(java.lang.Object object)
         throws QueryException
Set is not supported for scrollable cursors.

Specified by:
set in interface java.util.ListIterator
Throws:
QueryException

Copyright © 1998, 2012, Oracle. All Rights Reserved.