Skip to content
Sharp

OWASP Vulnerabilities · interview question

Which of the following is a primary defense mechanism against SQL Injection attacks in Java?

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

Correct answer

A. Using PreparedStatement with parameterized queries

Why

PreparedStatement with parameterized queries prevents SQL Injection by treating inputs as data rather than executable code. This ensures even malicious input is escaped properly.

Test yourself on OWASP Vulnerabilities

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

Start free test
All OWASP Vulnerabilities questions →