The DriverManager class belongs to the java.sql package and is responsible for managing JDBC drivers. It acts as an important component between a Java application and the JDBC drivers. The DriverManager selects an appropriate JDBC driver based on the database URL provided by the application. It is mainly used to establish a connection with a database using the getConnection() method. It also provides methods for registering, deregistering, and retrieving JDBC drivers.
Methods of DriverManager
| Method Signature and Short Description |
|---|
|
Establishes a connection to the database using the specified JDBC URL. |
|
Establishes a database connection using the specified URL, username, and password. |
|
Establishes a database connection using the specified URL and connection properties. |
|
Registers the specified JDBC driver with the |
|
Removes the specified JDBC driver from the registered drivers. |
|
Locates and returns a JDBC driver that understands the specified database URL. |
|
Returns all JDBC drivers currently registered with the |
|
Sets the maximum time allowed for establishing a database connection. |
|
Returns the maximum time allowed for establishing a database connection. |
|
Sets the output destination for JDBC driver logging and tracing. |
|
Returns the current logging and tracing output destination. |
|
Prints the specified message to the |
