nerdexam
GIAC

GSSP-JAVA · Question #151

You have the following code of a PreparedStatement. PreparedStatement stm = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?"); Which of the following statements are true about a…

The correct answer is A. The executeUpdate() method executes the SQL query in the PreparedStatement object B. A PreparedStatement reduces execution time if it is required to execute the SQL. See the full explanation below for the reasoning.

Question

You have the following code of a PreparedStatement. PreparedStatement stm = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?"); Which of the following statements are true about a PreparedStatement? Each correct answer represents a complete solution. Choose all that apply.

Options

  • AThe executeUpdate() method executes the SQL query in the PreparedStatement object
  • BA PreparedStatement reduces execution time if it is required to execute the SQL
  • CWhen the executeQuery() method is used to execute a DDL statement, such as in
  • DIt is illegal for an instance of a PreparedStatement to contain a SQL statement that has

How the community answered

(28 responses)
  • A
    82% (23)
  • C
    11% (3)
  • D
    7% (2)

Community Discussion

No community discussion yet for this question.

Full GSSP-JAVA Practice