executeQuery(String sql)

Syntax:

ResultSet executeQuery(String sql)
                       throws SQLException

Description:

Executes the given SQL statement, which returns a single ResultSet object.

Parameters:

sql

an SQL statement to be sent to the database, typically a static SQL SELECT statement

Returns:

a ResultSet object that contains the data produced by the given query; never null

Throws:

SQLException - if a database access error occurs or the statement has been closed

Reference:

For more information, reference JDBC documentation for: Statement.executeQuery(String)