Set or get the query for ResultSet