PrepAway - Latest Free Exam Questions & Answers

Which of the following JDBC Statement’s methods is best to be used for executing SQL statements that ret

Which of the following JDBC Statement’s methods is best to be used for executing
SQL statements that return a single ResultSet?

PrepAway - Latest Free Exam Questions & Answers

A.
executeQuery(.

B.
executeUpdate(.

C.
execute(.

D.
runQuery(.

E.
runUpdate(.

F.
run (.

Explanation:
Quoted directly from Sun’s Java document site at
http//developer.java.sun.com/ The execute series are the most often used of
Statement’s methods
executeQuery(. is used to execute SQL statements that return a single ResultSet.
executeUpdate(. is used to execute SQL statements that modify a table or values of
columns in a table and return the number of rows affected (which is zero in the case of
DDL statements..
execute(. can be used to execute any type of SQL statement, but is intended for those that
can return multiple results or values. execute(. is not discussed further in the course.


Leave a Reply