public int getTestFailures(UUID batchId, Boolean persist){
        int failures=0;
        if(persist){

            connectDb();

            String env = System.getenv("ENV");
            String tableName = env.substring(0, 1).toUpperCase() + env.substring(1).toLowerCase() + "TestResults";
            try {
                String sql = "select sum(failed) as failed from "+tableName+" where batchId='"+batchId+"'";
                PreparedStatement ps = (PreparedStatement) conn.prepareStatement(sql);
                ResultSet rs = ps.executeQuery(sql);
                rs.next();
                failures = rs.getInt("failed");


                ps.close();
            } catch (Exception e) {
                e.printStackTrace();
            }

            try {
                //conn.close();
            } catch (Exception exp) {
                exp.printStackTrace();

            }
        }

        return failures;
    }