Multiple choice technology

Which type of Statement can execute parameterized queries?

  1. PreparedStatement

  2. ParameterizedStatement

  3. ParameterizedStatement and CallableStatement

  4. All kinds of Statements (i.e. which implement a sub interface of Statement)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

PreparedStatement is specifically designed to execute parameterized queries efficiently and safely. It pre-compiles SQL statements with placeholders (?) that are filled with parameter values at runtime, providing better performance and protection against SQL injection. Option B is fictional, and CallableStatement is for stored procedures.