While you could use a continue
, why not just inverse the logic in your if?
while(rs.next())
{
if(!f.exists() || f.isDirectory()){
//proceed
}
}
You don't even need an else {continue;}
as it will continue anyway if the if
conditions are not satisfied.