Java SE 8 Programmer II — Question 197

Which code fragment is required to load a JDBC 3.0 driver?

Answer options

Correct answer: B

Explanation

The correct answer is B because the Class.forName method is used to load the JDBC driver class specified by its name. The other options either incorrectly attempt to load the driver or establish a connection without first loading the driver class.