Connection c = new DataConnection().getDBconnection();
PreparedStatement p = c.prepareStatement("SELECT bet_Number, SUM(Amount) FROM bet_tbl WHERE bet_Date = ? and status = ? GROUP BY bet_Number");
p.setString(1, "2013-07-02");
p.setString(2, "0");
ResultSet rs = p.executeQuery();
while (rs.next()) {
if(rs.getString(1).equals("01")){lbl01.setText(rs.getString(2));}
if(rs.getString(1).equals("02")){lbl02.setText(rs.getString(2));}
if(rs.getString(1).equals("03")){lbl03.setText(rs.getString(2));}
if(rs.getString(1).equals("04")){lbl04.setText(rs.getString(2));}
if(rs.getString(1).equals("05")){lbl05.setText(rs.getString(2));}
if(rs.getString(1).equals("06")){lbl06.setText(rs.getString(2));}
if(rs.getString(1).equals("07")){lbl07.setText(rs.getString(2));}
if(rs.getString(1).equals("08")){lbl08.setText(rs.getString(2));}
if(rs.getString(1).equals("09")){lbl09.setText(rs.getString(2));}
if(rs.getString(1).equals("10")){lbl10.setText(rs.getString(2));}
if(rs.getString(1).equals("11")){lbl11.setText(rs.getString(2));}
}
質問する
127 次