public abstract ResultSet executeQuery (String sql) throws SQLException

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

Note:This method cannot be called on a PreparedStatement or CallableStatement.

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

Exceptions:
SQLException    if a database access error occurs, this method is called on a closed Statement, the given SQL statement produces anything other than a single ResultSet object, the method is called on a PreparedStatement or CallableStatement
SQLTimeoutException    when the driver has determined that the timeout value that was specified by the setQueryTimeout method has been exceeded and has at least attempted to cancel the currently running Statement