1Z0-805 · Question #83
Which code fragment is required to load a JDBC 3.0 driver?
The correct answer is B. Class.forname ("org.xyzdata.jdbc.NetWorkDriver"). Note that your application must manually load any JDBC drivers prior to version 4.0. The simplest way to load a driver class is to call the Class.forName() method. If the fully-qualified name of a class is available, it is possible to get the corresponding Class using the…
Question
Which code fragment is required to load a JDBC 3.0 driver?
Options
- ADriverManager.loadDriver("org.xyzdata.jdbc.network driver");
- BClass.forname ("org.xyzdata.jdbc.NetWorkDriver");
- CConnection con = Connection.getDriver
- DConnection con = Drivermanager.getConnection
How the community answered
(19 responses)- A5% (1)
- B68% (13)
- C11% (2)
- D16% (3)
Explanation
Note that your application must manually load any JDBC drivers prior to version 4.0. The simplest way to load a driver class is to call the Class.forName() method. If the fully-qualified name of a class is available, it is possible to get the corresponding Class using the static method Class.forName().
Topics
Community Discussion
No community discussion yet for this question.