← All topics
Quiz: JDBC: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Which JDBC object holds the rows returned by a SELECT?
- Q2. Why is PreparedStatement safer than building SQL with string concatenation?
- Q3. Which method should you call for an UPDATE statement?
- Q4. In TransferDemo, why are both balances unchanged after the failed transfer?
- Q5. What is the first column index in a JDBC ResultSet?
- Q6. Why should a Connection be opened in try-with-resources?
- Q7. What does executeUpdate() return for an UPDATE statement?
- Q8. Which pair of calls makes several statements all-or-nothing?
- Q9. What is the main reason real apps use a connection pool such as HikariCP?
- Q10. A user types ' OR '1'='1 into an email box. With a PreparedStatement using ?, what happens?