Skip to content
Sharp

SQL for Java Devs · interview question

Which JDBC method is used to execute a query that returns a ResultSet?

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

Correct answer

D. ExecuteQuery()

Why

The executeQuery() method is used to execute SQL queries that return a ResultSet. This method is commonly used with SELECT statements to retrieve data from the database.

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 →