Page 1 of 1

About Question enthuware.ocpjp.v8.2.1767 :

Posted: Tue Aug 30, 2022 2:32 pm
by jrzabott
The current justification is not related with the question at all. The correct explanation should include all the three DriverManager.getConnection() overloads and the correct order of invoking the methods.
In this case, create a Properties object to put all parameters together, set all desired properties, then invoke the correct DriverManager.getConnection() overload (String, Properties) - in this case.

Plus, there is no method Connection.connect().

Did I say something wrong, improper or ambiguous? Please, feel free to comment.

Re: About Question enthuware.ocpjp.v8.2.1767 :

Posted: Tue Aug 30, 2022 2:33 pm
by jrzabott
Applications no longer need to explicitly load JDBC drivers using Class.forName(). The DriverManager methods getConnection and getDrivers have been enhanced to support the Java Standard Edition Service Provider mechanism. JDBC 4.0 Drivers must include the file META-INF/services/java.sql.Driver. This file contains the name of the JDBC drivers implementation of java.sql.Driver. For example, to load the my.sql.Driver class, the META-INF/services/java.sql.Driver file would contain the entry: my.sql.Driver When the method getConnection is called, the DriverManager will attempt to locate a suitable driver from amongst those loaded at initialization and those loaded explicitly using the same classloader as the current applet or application.

Re: About Question enthuware.ocpjp.v8.2.1767 :

Posted: Wed Aug 31, 2022 12:23 am
by admin
Explanation has been enhanced to include your suggestion.
thank you for your feedback!