Skip to content
Snippets Groups Projects
Commit 046f2f79 authored by sbobo3's avatar sbobo3
Browse files

Added new FormValidationException to throw "no results returned" when database...

Added new FormValidationException to throw "no results returned" when database query results are empty.
parent 38ab3386
No related branches found
No related tags found
2 merge requests!7Uc20,!2UC20 Data Access Object Completed
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
......@@ -144,6 +144,8 @@ public class CauseOfDeathTrendsReportDAO {
causes.add(new CauseOfDeathTrendsReportBean(name, cause, deaths));
count++;
}
if (causes.isEmpty())
throw new FormValidationException("No results returned");
rs.close();
stmt.close();
} catch (SQLException e) {
......@@ -220,6 +222,8 @@ public class CauseOfDeathTrendsReportDAO {
causes.add(new CauseOfDeathTrendsReportBean(name, cause, deaths));
count++;
}
if (causes.isEmpty())
throw new FormValidationException("No results returned");
rs.close();
stmt.close();
} catch (SQLException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment