Unfortuantely, there is no such method available in
Java API. Either you use count(*) to get the row count or if you want to know the no of records after query is executed, keep a counter variable and increment it before your while loop ends for each record.