Thursday, December 3, 2009

Result Set

What is Result Set?

An SQL result set is a set of rows from a database, as well as meta-information about the query such as the column names, and the types and sizes of each column. Depending on the database system, the number of rows in the result set may or may not be known. Usually, this number is not known up front because the result set is built on-the-fly. Precomputations often impose undesired performance impacts.

A result set is effectively a table. The ORDER BY clause can be used in a query to impose a certain sort condition on the rows. Without that clause, there is no guarantee whatsoever on the order in which the rows are returned.

On whole it has following features:
*The data in a ResultSet object is organized in rows and columns.
*A cursor (pointer) is also maintained in a ResultSet object to identify the current data row.
*A ResultSet object also contains ResultSet meta data which provides column definitions.
*ResultSet objects support 3 types of scrollabilities: TYPE_FORWARD_ONLY (default), TYPE_SCROLL_INSENSITIVE, and TYPE_SCROLL_SENSITIVE.
*ResultSet objects support 2 types of update capabilities: CONCUR_READ_ONLY (default) and CONCUR_UPDATABLE.
*ResultSet objects support 3 types of fetch direction hints: FETCH_FORWARD (default), FETCH_REVERSE, and FETCH_UNKNOWN.

No comments:

Post a Comment