About Question enthuware.ocpjp.v8.2.1767 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
jrzabott
Posts: 3
Joined: Mon Mar 28, 2022 10:49 am
Contact:

About Question enthuware.ocpjp.v8.2.1767 :

Post 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.

jrzabott
Posts: 3
Joined: Mon Mar 28, 2022 10:49 am
Contact:

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

Post 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.

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Explanation has been enhanced to include your suggestion.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests