Skip to content
Sharp

SQL for Java Devs · interview question

Why is it important to close a ResultSet object after use?

Multiple choiceHardchapter-8-curatedpremiumsql-for-java-devsresultsets-and-mapping
Choose one answer
Answer and explanation

Correct answer

A. Prevents memory leaks

Why

Closing a ResultSet releases the database and JDBC resources associated with it, preventing potential memory leaks and ensuring efficient resource management.

Test yourself on SQL for Java Devs

A free test with instant, explained results. No account needed.

Start free test
All SQL for Java Devs questions →