If you want to find the resultset size in a seperate method, the above response would work. If the resultset is huge, then a call like that could be expensive? Another option would be just to a have a simple count variable which is incremented by one for every iteration?