Java SE 11 Developer (1Z0-819) — Question 202

Examine:

Class.forName(JDBC_DRIVER_CLASS_NAME);

When is it necessary to execute this statement?

Answer options

Correct answer: B

Explanation

The correct answer is B, as the Class.forName method is not required in newer JDBC versions due to automatic driver loading. Option A is incorrect because it implies a necessity that no longer exists. Option C incorrectly suggests that it must be called repeatedly, and option D also misrepresents the current practice as it suggests a mandatory execution before any driver interaction.