Java OCA OCP Practice Question 2017

Question

Which method is overloaded to allow passing a username and password?.

  • A. forName()
  • B. getConnection()
  • C. getStatement()
  • D. None of the above


B.

Note

The DriverManager.getConnection() method can be called with just a URL.

It is also overloaded to take the URL, username, and password, making Option B correct.




PreviousNext

Related