JDBC Metadata Database - Quiz Explanation

Metadata Database Explanation of Answers

The answers you selected are indicated below, along with the text that explains the correct answers.

1. Why would you use a Statement object in the Brazilian Hospital Project?
Please select the best answer.
  A. To send a ResultSet to a data source
  B. To send a SQL Statement to a data source
  C. To send a scroll command to the cursor
  D. To set a user password
  The correct answer is B. The Statement object is to supply the argument in one of the execute methods, making the connection to the data source. Answer A is incorrect. ResultSet objects are not sent, they are returned. Answer C is incorrect because scrolling is performed after a result set is returned. Answer D is incorrect because user passwords are set in a system dependent mechanism.


2. Why would you want to know about the database meta-data in the Brazilian Hospital Project?
Please select the best answer.
  A. To find out information about the database driver, DBMS, table column names, or other information about the hospital databases
  B. To find out if the data contained in a column for each of the doctors and hospitals is accurate
  C. To find out whether the rows and columns in each database are complete
  D. To create the database tables
  The correct answer is A. The DatabaseMetaData class provides a way to get system information. The other information in answers B and C are specific pieces of content in the database. Answer D is incorrect because meta-data methods do not provide a means to manipulate data or tables.