You can call hasNext().  Usually you put your row processing within a while 
loop that checks hasNext()

   ResultSet results = qe.execSelect();

   while (results.hasNext()) {
      QuerySolution next = results.nextSolution();
             ...
   }


> -----Original Message-----
> From: sourajit basak [mailto:[email protected]]
> Sent: Wednesday, August 24, 2011 7:35 AM
> To: [email protected]
> Subject: how to check an empty resultset
> 
> After I execute a SPARQL, is there any way to check if the ResultSet is
> empty ? It seems that there is no easy way but to call nextSolution(..
> and catch the exception.
> 
> Maybe I am feeling too sleepy or something important is missing :-))

Reply via email to