这个结果只给我11,8,9。我想总和成为28.然后将结果用于下一个我的计算11/28 = 0,39和8/28 = 0,28和9/28 = 0,32。然后显示最终结果。帮帮我
try{
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/hitung1","root","");
String sql = ("select angka1,angka2 from tabel1 ");
PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
while(rs.next()){
double a=rs.getInt("angka1");
double b=rs.getInt("angka2");
double d=b+a;
System.out.println("" +d);
} }
catch(Exception e){}
e