for loop to retrieve and increase the value
hi all, i have been trying to solve the problem with this for loop.
im trying to get the month of each data made by a company.
ArrayList stringList1 = dao.retrieveAllBooking();
for (int b = 0; b < stringList1.size(); b++) {
ab = (AllBooking) stringList1.get(b);
d = ab.getDATE_OF_USE_TO();
StringTokenizer ss = new StringTokenizer((String) d, "/");
String day = ss.nextToken();
String month = ss.nextToken();
String year = ss.nextToken();
if(month.equals("JAN")){
JanDR++;
}
if(month.equals("FEB")){
FebDR++;
}
if(month.equals("MAR")){
MarDR++;
}
if(month.equals("APR")){
AprDR++;
}
if(month.equals("MAY")){
MayDR++;
}
if(month.equals("JUN")){
JunDR++;
}
if(month.equals("JUL")){
JulDR++;
}
if(month.equals("AUG")){
AugDR++;
}
if(month.equals("SEP")){
SepDR++;
}
if(month.equals("OCT")){
OctDR++;
}
if(month.equals("NOV")){
NovDR++;
}
if(month.equals("DEC")){
DecDR++;
}
Object[] data={Org,JanDR, FebDR, MarDR, AprDR,
MayDR, JunDR, JulDR, AugDR, SepDR,
OctDR, NovDR, DecDR, JanSR, FebSR,
MarSR, AprSR, MaySR, JunSR, JulSR,
AugSR, SepSR, OctSR, NovSR, DecSR};
tableModel.addRow(data); //add the data to the table.
}
i want to create a summary page for monthly usage. which means, if someone booked on JANUARY twice, the number of JANUARY column will show 2. instead, it gives me a new record in the summary table with month increasing irrelevantly.
please help! any help will be greatly appreciated!

