Skip to content
Sharp

OWASP Vulnerabilities · interview question

Which Java class is commonly used to prevent SQL Injection by safely handling SQL queries?

Multiple choiceMediumchapter-17-curatedpremiumowasp-vulnerabilitiessql-injection
Choose one answer
Answer and explanation

Correct answer

D. PreparedStatement

Why

PreparedStatement is designed to safely execute SQL queries using parameterized queries, which treat user input as data rather than executable code, thus mitigating SQL Injection risks.

Test yourself on OWASP Vulnerabilities

A free test with instant, explained results. No account needed.

Start free test
All OWASP Vulnerabilities questions →