What does the getConnection method of DriverManager class do?

  • Closes an existing connection.
  • Establishes a connection to a database.
  • Executes a SQL query.
  • Retrieves the JDBC driver's info.
The getConnection method of the java.sql.DriverManager class is used to establish a connection to a database. It takes parameters like the database URL, username, and password to create a connection to the specified database server. It does not close connections, retrieve driver info, or execute SQL queries.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *