Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
D) DriverManager.getConnection()
E) DriverManager.getJDBCConnection()
6. Given this code fragment:
// assume "myURL" is a valid URL
try {
Connection conn =
DriverManager.getConnection(myURL);
Statement s = conn.createStatement();
// use SQL to add 100 to a checking account
// use more SQL to add 300 to the account
conn.commit();
} catch (Exception e) {
e.printStackTrace();
}
What is the result?
A) Compilation fails.
B) An exception is thrown at run time.
C) The account's value is not changed.
D) The account's value is incremented by 100.
E) The account's value is incremented by 300.
F) The account's value is incremented by 400.
7. Implementing which method will properly extend java.util.ListResourceBundle?
A) addContents()
B) getContents()
C) addResources()
D) getResources()
E) getKeys()
Answers
1. F
2. A
3. E
4. B, D
5. D
6. B
7. B