← Quiz: JDBC: all 10 questions
Quiz: JDBC · Question 10 of 10
A user types ' OR '1'='1 into an email box. With a PreparedStatement using ?, what happens?
A user types ' OR '1'='1 into an email box. With a PreparedStatement using ?, what happens?
- A.Every user is returned
- B.The database crashes
- C.The text is treated as a plain value, so it matches no real email
- D.The driver throws a syntax error
Answer & explanation
Correct answer: The text is treated as a plain value, so it matches no real email
The value is sent separately from the SQL, so it can never change the query's meaning.
Can you get the rest right without peeking?
Take the timed Quiz: JDBC quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →