    All Packages    This Package  Previous  Next

# Interface sqlj.runtime.ResultSetIterator

public interface interface ResultSetIterator

An interface that defines the shared functionality of those objects used to iterate over the contents of a result set.

##

ASENSITIVE
  Constant used by the "sensitivity" field, indicating that the iterator is defined to have an asensitive cursor.
INSENSITIVE
  Constant used by the "sensitivity" field, indicating that the iterator is defined to have an insensitive cursor.
SENSITIVE
  Constant used by the "sensitivity" field, indicating that the iterator is defined to have a sensitive cursor.

##

close()
  Closes the iterator object, releasing any underlying resources.
getResultSet()
  Returns the JDBC result set associated with this iterator.
isClosed()
next()
  Advances the iterator to the next row.

##

ASENSITIVE

     public static final int ASENSITIVE

  Constant used by the "sensitivity" field, indicating that the iterator is defined to have an asensitive cursor.

INSENSITIVE

     public static final int INSENSITIVE

  Constant used by the "sensitivity" field, indicating that the iterator is defined to have an insensitive cursor.

SENSITIVE

     public static final int SENSITIVE

  Constant used by the "sensitivity" field, indicating that the iterator is defined to have a sensitive cursor.

##

close

     public abstract void close() throws SQLException

  Closes the iterator object, releasing any underlying resources. It is recommended that iterators be explicitely closed as soon as they are no longer needed to allow for the immediate release of resources that are no longer needed.

  Note: If it is not already closed, an iterator is automatically closed when it is garbage collected.

  Throws: SQLException
    If there is a problem closing the iterator.
  See Also:
    isClosed

isClosed

     public abstract boolean isClosed() throws SQLException

  Returns:
    true if the `close` method on this iterator has been called, false otherwise.
  Throws: SQLException
    if an error occurs determining the close-status of the iterator.
  See Also:
    close

next

     public abstract boolean next() throws SQLException

  Advances the iterator to the next row. At the begining the iterator is positioned before the first row.

  Note: A FETCH..INTO statement performs an implicit `next` call on the iterator passed.

  Returns:
    true if there was a next row in the iterator, false otherwise.
  Throws: SQLException
    If an exception occurs while changing the position of the iterator.

getResultSet

     public abstract ResultSet getResultSet() throws SQLException

  Returns the JDBC result set associated with this iterator. The result set produced must have normal JDBC functionality, as defined in the JDBC specification (in particular, SQL NULL values fetched with primitive accessor methods will not raise a SQLNullException). This method is provided to facilitate interoperablity with JDBC.

  Notes:

  - Support for this method is implementor defined and not part of Core SQLJ. An SQLException will be thrown if this method is not supported.
  - If an implementor supports this method, then any synchronization between the iterator and the produced result set is implementor defined.
  - For maximum portability this method should be invoked before the first `next` method invocation on the iterator. Once the result set has been produced, all operations to fetch data should be through the result set.

  Returns:
    a JDBC result set for this iterator.
  Throws: SQLException
    if no result set is available for this iterator.

    All Packages    This Package  Previous  Next