About Question enthuware.ocpjp.v8.2.1767 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

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: 10043
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!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests