COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
By invoking the method get( ____, String type) on the ResultSet, where type is the database type
|
|
By invoking the method get( ____, Type type) on the ResultSet, where Type is an object which represents a database type
|
|
By invoking the method getValue( ____ ), and cast the result to the desired Java type.
|
|
By invoking the special getter methods on the ResultSet:getString( ____ ), getBoolean ( ____ ), getClob( ____ ), ____
|
Detailed explanation-1: -How can you retrieve information from a ResultSet? By invoking the method getValue(…), and cast the result to the desired Java type. By invoking the special getter methods on the ResultSet: getString(…), getBoolean (…), getClob(…), …
Detailed explanation-2: -The ResultSet interface declares getter methods (for example, getBoolean and getLong ) for retrieving column values from the current row. You can retrieve values using either the index number of the column or the alias or name of the column. The column index is usually more efficient. Columns are numbered from 1.
Detailed explanation-3: -Return value This method returns a boolean value specifying whether the ResultSet object contains more rows. If there are no rows next to its current position this method returns false, else it returns true. Using this method in the while loop you can iterate the contents of the result set.