1. Why is PreparedStatement preferred over Statement in real-world applications?
- It uses less memory
- It prevents SQL injection and improves performance
- It supports only SELECT queries
- It does not require connection
Reveal sample answer and explanation
Answer: It prevents SQL injection and improves performance
PreparedStatement improves security and performance by precompiling SQL.