Computer Science
Assertion. The database cursor and resultset have the same data yet they are different.
Reason. The database cursor is a control structure and the resultset is a logical set of records.
Answer
(a)
Both Assertion and Reason are true and Reason is the correct explanation of Assertion.
Explanation
The database cursor and result set both have data from the database but serve different purposes and are distinct entities. A database cursor is a special control structure that facilitates the row-by-row processing of records in the result set, i.e., the set of records retrieved as per the query. On the other hand, the result set refers to a logical set of records that are fetched from the database by executing an SQL query and made available to the application program.
Related Questions
Assertion. A database connection object controls the connection to a database.
Reason. A connection object represents a unique session with a database, connected from within a script/program.
Assertion. A database cursor receives all the records retrieved as per the query.
Reason. A resultset refers to the records in the database cursor and allows processing of individual records in it.
Assertion. One by one the records can be fetched from the database directly through the database connection.
Reason. The database query results into a set of records known as the resultset.
Assertion. The cursor rowcount returns how many rows have been retrieved so far through fetch…() methods.
Reason. The number of rows in a resultset and the rowcount are always equal.