🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Every user is returned
  2. B.The database crashes
  3. C.The text is treated as a plain value, so it matches no real email
  4. 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 →