Home » Oracle » 1z0-804 » Which two actions can be used in registering a JDBC 3.0 driver?
Which two actions can be used in registering a JDBC 3.0 driver?
A. Add the driver class to the META-INF/services folder of the JAR file.
B. Set the driver class name by using the jdbc.drivers system property.
C. Include the JDBC driver class in a jdbcproperties file.
D. Use the java.lang.class.forName method to load the driver class.
E. Use the DriverManager.getDriver method to load the driver class.
Correct Answer: AD
Explanation/Reference:
Explanation:
A: if your JDBC Driver is NOT JDBC 4-compliant then we can update the driver using "jar"-utility by adding the "META-INF /services/java.sql.Driver" inside it. as following:
D:Dynamic loading of Java classes at runtime provides tremendous flexibility in the development of enterprise systems. It provides for the basis of "application servers", and allows even simpler, lighter-weight systems to accomplish some of the same ends. Within Java, dynamic-loading is typically achieved by calling the forName method on the class java.lang.Class An example provided by the standard Java SE API is the ServiceLoader. Among others, the JDBC 4.0 compatible drivers implement this. This way just dropping the JDBC driver JAR file folder will automatically load the driver class during Java application’s startup/initialization without the need for any manual Class.forName ("com.example.Driver") line in your code.
Download Printable PDF. VALID exam to help you PASS.
|
|
Correct Answer: BD
A is JDBC 4