Java SE 8 Programmer II — Question 126
Which statement is true about the DriverManager class?
Answer options
- A. It returns an instance of database.
- B. It executes SQL statements against the database.
- C. It loads the database driver class mentioned in the jdbc.drivers property
- D. it is written by different vendors for their specific database.
Correct answer: A
Explanation
The correct answer is A because the DriverManager class is responsible for establishing a connection to the database and returning an instance of it. Option B is incorrect as executing SQL statements is the responsibility of the Connection object. Option C is misleading since DriverManager loads the driver classes but does not return instances through jdbc.drivers. Option D is also wrong because DriverManager is a standard part of Java and not vendor-specific.