Java OCA OCP Practice Question 2013

Question

Which is responsible for getting a connection to the database?.

  • A. Driver
  • B. Connection
  • C. Statement
  • D. ResultSet


A.

Note

The Driver interface is responsible for getting a connection to the database, making Option A the answer.

The Connection interface is responsible for communication with the database but not making the initial connection.

The Statement interface knows how to run the SQL query, and the ResultSet interface knows what was returned by a SELECT query.




PreviousNext

Related