Java DriverManager getConnection() MethodThe getConnection(String url) method of Java DriverManager class attempts to establish a connection to the database by using the given database URL. The appropriate driver from the set of registered JDBC drivers is selected. SyntaxParametersurl - a database url of the form jdbc:subprotocol:subname ReturnsThis method returns connections to the URL. ExceptionSQLException will be thrown, if database access occurs or url is null. SQLTimeoutException will be thrown, when the timeout value specified by the setLoginTimeout method has been exceeded and tried to cancel the current database connection attempt. Example |