//compute percentage for Parent1
DecimalFormat df = new DecimalFormat("#.##%");
rs = s.executeQuery("SELECT "
+ "(SELECT COUNT(*) FROM genetic.blood_type where diseases = '" + disease1 + "')"
+ "/COUNT(*) AS rowcount FROM genetic.blood_type where btype = '" + btype1 + "'");
rs.next();
int result = rs.getInt("rowcount");
rs.close();
out.println(disease1 + " is " + df.format(result) +" "+ result);
-acir- 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.