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!

[1740 byte] By [KarenCWa] at [2007-11-27 11:09:14]
# 1

If other part of your code is all good, tableModel.addRow() should properly update the table on the screen.

> month increasing irrelevantly

We find no clue in your posted code. Try debug with a dummy data, not a real DB data.

hiwaa at 2007-7-29 13:34:09 > top of Java-index,Java Essentials,Java Programming...
# 2

Thanks for your reply!!

i found out it increases irrelevantly due to the previous 'for loop' statement.

i am able to move on to the next part of the code.

one more time, thanks.

KarenCWa at 2007-7-29 13:34:09 > top of Java-index,Java Essentials,Java Programming...