Fix hasnext() method, mysql doesn't have that method