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.
Loading...
Related Quiz
- The process of instantiating a class and creating an object is also known as _______.
- What is the effect of calling the yield() method in a thread?
- Which of the following operators will determine whether two values are not equal?
- The class ________ provides methods to work with SSL sockets.
- The method ________ is used to send HTTP GET request without parameters.