Skip to content
Sharp

SQL for Java Devs · interview question

Which JDBC method is used to execute a SQL SELECT query and retrieve data?

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

Correct answer

A. ExecuteQuery()

Why

The executeQuery() method is used in JDBC to execute a SQL SELECT query, which returns a ResultSet containing the retrieved data.

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 →