Skip to content
Sharp

SQL for Java Devs · interview question

What might be a consequence of not closing a PreparedStatement in a database-heavy e-commerce application?

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

Correct answer

D. Excessive memory and resource consumption.

Why

Failing to close a PreparedStatement can lead to excessive memory and resource consumption because it holds database resources even after the operation is completed, which can degrade performance in database-heavy applications.

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 →