executeQuery()

Syntax:

ResultSet executeQuery()
                       throws SQLException

Description:

Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.

Returns:

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

Throws:

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

Reference:

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