dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #02581
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 865: Minor fix
------------------------------------------------------------
revno: 865
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-10-15 18:03:56 +0200
message:
Minor fix
modified:
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/statistics/jdbc/JdbcStatisticsProvider.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/statistics/jdbc/JdbcStatisticsProvider.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/statistics/jdbc/JdbcStatisticsProvider.java 2009-10-07 18:53:11 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/statistics/jdbc/JdbcStatisticsProvider.java 2009-10-15 16:03:56 +0000
@@ -32,6 +32,7 @@
import org.hisp.dhis.common.Objects;
import org.hisp.dhis.statistics.StatisticsProvider;
+import org.springframework.jdbc.BadSqlGrammarException;
import org.springframework.jdbc.core.JdbcTemplate;
/**
@@ -71,8 +72,16 @@
objectCounts.put( Objects.VALIDATIONRULE, jdbcTemplate.queryForInt( "SELECT COUNT(*) FROM validationrule" ) );
objectCounts.put( Objects.PERIOD, jdbcTemplate.queryForInt( "SELECT COUNT(*) FROM period" ) );
objectCounts.put( Objects.DATAVALUE, jdbcTemplate.queryForInt( "SELECT COUNT(*) FROM datavalue" ) );
- objectCounts.put( Objects.AGGREGATEDDATAVALUE, jdbcTemplate.queryForInt( "SELECT COUNT(*) FROM aggregateddatavalue" ) );
- objectCounts.put( Objects.AGGREGATEDINDICATORVALUE, jdbcTemplate.queryForInt( "SELECT COUNT(*) FROM aggregatedindicatorvalue" ) );
+
+ try
+ {
+ objectCounts.put( Objects.AGGREGATEDDATAVALUE, jdbcTemplate.queryForInt( "SELECT COUNT(*) FROM aggregateddatavalue" ) );
+ objectCounts.put( Objects.AGGREGATEDINDICATORVALUE, jdbcTemplate.queryForInt( "SELECT COUNT(*) FROM aggregatedindicatorvalue" ) );
+ }
+ catch ( BadSqlGrammarException ex )
+ {
+ // Ignore since tables might be dropped and do not exist
+ }
return objectCounts;
}