Which TWO of the following are effective defenses against SQL injection attacks?
Object-Relational Mappers (ORMs) provide an effective defense against SQL injection by abstracting database interactions and typically generating parameterized queries. Instead of concatenating user input directly into SQL strings, ORMs bind input values as parameters, ensuring they are treated as data and not executable code. This fundamental separation prevents malicious input from altering the query's structure, thereby neutralizing injection attempts.
Why this answer
Prepared statements (parameterized queries) and stored procedures (if properly parameterized) prevent SQL injection by separating data from code.