Java / JDBC
What is the role of DriverManager in JDBC?
DriverManager locates a registered Driver for a JDBC URL and opens a Connection. Prefer a DataSource in servers; DriverManager is the basic standalone entry point.
DriverManager is a factory class that is responsible for maintaining the single instance of each registered driver. DriverManager eliminates having multiple instances of the same driver as it is Singleton.
The DriverManager acts as a registry and provides lookup mechanism by taking the connection URL and finding the suitable driver for it. When a driver understands the URL, DriverManager passes the URL to it to create the database connection.
More Related questions...