This is a fairly common question and I recommend using the search facility first. You'll get several threads like
this one Keep in mind that there are several options, and all the options are not always covered in each individual
thread.
You can do a dummy call that returns a count of the results rather than the results,
You can iterate through the results as you process them and keep a count,
If you have scrollable ResultSets you can jump to the last and see what item number it is.
There may be others, but I forget...
Dave