sqlj.runtime

Interface Scrollable


public interface Scrollable

This interface is not usable with Open SQL / SQLJ. Scrollable result sets are not supported in Open SQL for Java.

This interface provides a set of methods that all scrollable iterator objects support. The effect of an update on a Scrollable iterator object is implementation-defined.


Method Summary
 boolean absolute(int row)
          Moves the iterator object to the row with the given row number.
 void afterLast()
          Moves the iterator object to immediately after its last row.
 void beforeFirst()
          Moves the iterator object to immediately before its first row.
 boolean first()
          Moves the iterator object to its first row.
 int getFetchDirection()
          Retrieves the direction for fetching rows for this iterator object.
 boolean isAfterLast()
          Indicates whether the iterator object is after its last row.
 boolean isBeforeFirst()
          Indicates whether the iterator object is before its first row.
 boolean isFirst()
          Indicates whether the iterator object is on its first row.
 boolean isLast()
          Indicates whether the iterator object is on its last row.
 boolean last()
          Moves the iterator object to its last row.
 boolean previous()
          Moves the iterator object to its previous row.
 boolean relative(int rows)
          Moves the iterator object the given number of rows, either positive or negative, from its current position.
 void setFetchDirection(int direction)
          Gives the SQLJ runtime a hint as to the direction in which rows of this iterator object are processed.
 

Method Detail

absolute

boolean absolute(int row)
                 throws SQLException
Moves the iterator object to the row with the given row number. If the row number is positive, the iterator object moves to the row with the given row number with respect to its beginning. The first row is row 1, the second is row 2, and so on. If the given row number is negative, the iterator object moves to an absolute row position with respect to its end. For example, calling absolute(-1) positions the iterator object on the last row, absolute(-2) indicates the next-to-last row, and so on. An attempt to position the iterator object beyond its first or last row leaves the iterator object before or after its first or last row, respectively.

Returns:
true if iterator object is on a row
Throws:
SQLException - if a database access error occurs or row is 0 (zero).

afterLast

void afterLast()
               throws SQLException
Moves the iterator object to immediately after its last row. Has no effect if the iterator object contains no rows.

Throws:
SQLException - if a database access error occurs

beforeFirst

void beforeFirst()
                 throws SQLException
Moves the iterator object to immediately before its first row. Has no effect if the iterator object contains no rows.

Throws:
SQLException - if a database access error occurs

first

boolean first()
              throws SQLException
Moves the iterator object to its first row.

Returns:
true if the iterator object is on a row; if there are no rows, then false.
Throws:
SQLException - if a database access error occurs

getFetchDirection

int getFetchDirection()
                      throws SQLException
Retrieves the direction for fetching rows for this iterator object. If this iterator object has not set a fetch direction by calling the method setFetchDirection( ), then the value returned is the default specified in Subclause 13.1.6.2.13, setFetchDirection (int).

Returns:
The fetch direction for this iterator object.
Throws:
SQLException - if a database access error occurs

isAfterLast

boolean isAfterLast()
                    throws SQLException
Indicates whether the iterator object is after its last row.

Returns:
If the iterator object is positioned after its last row, then true; otherwise false. Returns false when the iterator object contains no rows.
Throws:
SQLException - if a database access error occurs

isBeforeFirst

boolean isBeforeFirst()
                      throws SQLException
Indicates whether the iterator object is before its first row.

Throws:
SQLException - if a database access error occurs

isFirst

boolean isFirst()
                throws SQLException
Indicates whether the iterator object is on its first row.

Returns:
If the iterator object is positioned on its first row, then true; otherwise false. Returns false when the iterator object contains no rows.
Throws:
SQLException - if a database access error occurs

isLast

boolean isLast()
               throws SQLException
Indicates whether the iterator object is on its last row.

Returns:
If the iterator object is positioned on its last row, then true; otherwise false. Returns false when the iterator object contains no rows.
Throws:
SQLException - if a database access error occurs

last

boolean last()
             throws SQLException
Moves the iterator object to its last row.

Returns:
If the iterator object is positioned on a row, then true; otherwise false. Returns false when the iterator object contains no rows.
Throws:
SQLException - if a database access error occurs

previous

boolean previous()
                 throws SQLException
Moves the iterator object to its previous row.

Returns:
If the iterator object is positioned on a row, then true; if it is positioned before its first row or after its last row, then false. Returns false when the iterator object contains no rows.
Throws:
SQLException - if a database access error occurs

relative

boolean relative(int rows)
                 throws SQLException
Moves the iterator object the given number of rows, either positive or negative, from its current position. Attempting to move beyond its first or last row positions the iterator object before or after its first or last row, respectively. Invoking relative(0) is valid, but does not change the iterator object position.

Returns:
If the iterator object is positioned on a row, then true; otherwise false. Returns false when the iterator object contains no rows.
Throws:
SQLException - if a database access error occurs

setFetchDirection

void setFetchDirection(int direction)
                       throws SQLException
Gives the SQLJ runtime a hint as to the direction in which rows of this iterator object are processed. The default value is sqlj.runtime.ResultSetIterator.FETCH_FORWARD.

Throws:
SQLException - if a database access error occurs, or the given direction is not one of ResultSetIterator.FETCH_FORWARD, ResultSetIterator.FETCH_REVERSE, or ResultSetIterator.FETCH_UNKNOWN.
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] ENGFACADE [sap.com] tc/je/opensql/api api BC-JAS
[sap.com] ENGINEAPI [sap.com] opensqldeprecated default BC-JAS-PER-SQL
[sap.com] CORE-TOOLS [sap.com] com.sap.engine.client.libdeprecated default BC-JAS


Copyright 2012 SAP AG Complete Copyright Notice