Skip to content
Sharp

SQL for Java Devs · interview question

Which JDBC feature can be used to map SQL NULL values to Java null?

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

Correct answer

B. Rs.wasNull()

Why

The rs.wasNull() method checks if the last column read had a NULL value, allowing developers to map SQL NULLs to Java nulls accurately.

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 →