Which of the following is the Statement interface method that should be used to execute a SELECT statement?

a. executeSQL
b. executeStatement
c. executeUpdate
d. executeQuery


d. executeQuery

Computer Science & Information Technology

You might also like to view...

According to the CSS order of precedence, ______ styles override ________ styles.

a. external, embedded  b. embedded, inline  c. inline, external  d. external, inline

Computer Science & Information Technology

Analyze the following code:

``` public class Test { public static void main(String[] args) { Object a1 = new A(); Object a2 = new Object(); System.out.println(a1); System.out.println(a2); } } class A { int x; @Override public String toString() { return "A's x is " + x; } }``` a. The program cannot be compiled, because System.out.println(a1) is wrong and it should be replaced by System.out.println(a1.toString()); b. When executing System.out.println(a1), the toString() method in the Object class is invoked. c. When executing System.out.println(a2), the toString() method in the Object class is invoked. d. When executing System.out.println(a1), the toString() method in the A class is invoked.

Computer Science & Information Technology