Skip to content
Sharp

SQL for Java Devs · interview question

In a manual ORM implementation, which approach ensures all necessary fields are mapped from a ResultSet to a Java object?

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

Correct answer

C. Create a constructor that accepts a ResultSet.

Why

A constructor that accepts a ResultSet can ensure that all necessary fields are mapped during object creation, allowing centralized error handling and reducing the risk of missing fields.

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 →