private boolean verify ( ) throws SQLException { //check total num pageview String countAccessQuery = "SELECT COUNT(*) FROM Access" ; String sumPageviewQuery = "SELECT SUM(pageview) FROM Pageview" ; Statement st = null ; ResultSet rs = null ; try { st = connection . createStatement ( ) ; rs = st . executeQuery ( countAccessQuery ) ; rs . next ( ) ; long totalPageview = rs . getLong ( 1 ) ; rs = st . executeQuery ( sumPageviewQuery ) ; rs . next ( ) ; long sumPageview = rs . getLong ( 1 ) ; LOG . info ( "totalPageview=" + totalPageview ) ; LOG . info ( "sumPageview=" + sumPageview ) ; return totalPageview == sumPageview && totalPageview != 0 ; } finally { if ( st != null ) st . close ( ) ; if ( rs != null ) rs . close ( ) ; } }
Verifies the results are correct