SET OF
a complex type in the form
of a ResultSet
. The primary motivation for this interface is
that an implementation that returns a ResultSet must be able to close the
connection and statement when no more rows are requested.
A function returning a SET OF
a complex type generated on the
fly (rather than obtained from a query) would return
ResultSetProvider
instead. One returning a SET OF
a
simple type should simply return an Iterator
.
In the case of a function declared to return SETOF RECORD
rather than
of a complex type known in advance, SQL requires any query using the function
to include a column definition list. If the number of those columns does not
match the number in the ResultSet
returned here, only as many as the
caller expects (in index order starting with 1) will be used; an exception is
thrown if this result set has too few columns. If the types expected by the
caller differ, values are converted as if retrieved one by one from this
ResultSet
and stored into the caller's with
updateObject
.
A function that needs to know the names or types of the caller's expected
columns should implement ResultSetProvider
.
- Author:
- Thomas Hallgren
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Called after the last row has returned or when the query evaluator decides that it does not need any more rows.An implementation of this method will probably execute a query and return the result of that query.
-
Method Details
-
getResultSet
An implementation of this method will probably execute a query and return the result of that query.- Returns:
- The ResultSet that represents the rows to be returned.
- Throws:
SQLException
-
close
Called after the last row has returned or when the query evaluator decides that it does not need any more rows.- Throws:
SQLException
-