How is persistence implemented in enterprise beans?
How is persistence implemented in enterprise beans?
this is the new method , instead of Date pass Calendar object which need to be calculate
- public static int calcAge(Calendar dob) {
int age = 0;
Calendar curDate = Calendar.getInstance();
Calendar tmpDate = Calendar.getInstance();
tmpDate.setTime(dob.getTime());
tmpDate.set(Calendar.YEAR,curDate.get(Calendar.YEAR));
if (dob.before(curDate)) {
age = curDate.get(Calendar.YEAR) - dob.get(Calendar.YEAR);
if (tmpDate.after(curDate)) {
age--;
}
}
return age;
}
There are currently 1 users browsing this thread. (0 members and 1 guests)