* @return task descriptor or <code>null</code> if no more tasks
* @throws SQLException if accessing database fails
*/
public Task next(RequestContext context) throws SQLException {
HjGetNextRequest request = new HjGetNextRequest(context);
request.execute();
HjRecords records = request.getQueryResult().getRecords();
if (records.size() != 1) {
return null;
}
return new Task(records.get(0));