Which JDBC object is responsible for managing database drivers?

Prepare for the Object-Oriented Programming Test with flashcards and multiple choice questions. Each question comes with hints and explanations to enhance understanding. Master OOP concepts and succeed in your exam!

Multiple Choice

Which JDBC object is responsible for managing database drivers?

Explanation:
The ability to manage and select database drivers in JDBC is handled by a central registry that keeps track of all available drivers. This role is fulfilled by the DriverManager. It registers drivers when they’re loaded, and when you request a connection it asks the registered drivers which one can handle the given URL and then delegates to that driver to establish the connection. The other options serve different purposes: a Connection is the active session with a database; DataSource is a factory for obtaining connections (often with pooling and resource management); and a Driver is the specific driver implementation that speaks the database protocol.

The ability to manage and select database drivers in JDBC is handled by a central registry that keeps track of all available drivers. This role is fulfilled by the DriverManager. It registers drivers when they’re loaded, and when you request a connection it asks the registered drivers which one can handle the given URL and then delegates to that driver to establish the connection. The other options serve different purposes: a Connection is the active session with a database; DataSource is a factory for obtaining connections (often with pooling and resource management); and a Driver is the specific driver implementation that speaks the database protocol.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy