fyness
asked on
Java Calendar class - exception when using setTime()
Hi,
Can anyone see anything wrong with this while loop?
while (dateResultSet.next()) {
Date directDebitDate = dateResultSet.getDate("dir
Calendar allowable = Calendar.getInstance();
Calendar directDebitDueDate = Calendar.getInstance();
/* set calendar value to 3 days time */
allowable.add(Calendar.DAT
directDebitDueDate.setTime
/* if it falls before 3 days time it is classified as urgent */
if (directDebitDueDate.before
{
urgentPending ++;
System.out.println("Urgent
}else
{
regularPending ++;
System.out.println("Regula
}
}
When i run it the results from of the system.outs come up fine but the setTime method causes the following exception
Caused by: java.lang.NullPointerExcep
at java.util.Calendar.setTime
... 34 more
Caused by:
java.lang.NullPointerExcep
at java.util.Calendar.setTime
at ie.sentenial.business.data
at ie.sentenial.business.data
at ie.sentenial.application.a
at ie.sentenial.application.a
at org.apache.struts.action.R
at org.apache.struts.action.R
at org.apache.struts.action.A
at org.apache.struts.action.A
Any ideas anyone???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.