+ Reply to Thread
Results 1 to 2 of 2

Thread: How is persistence implemented in enterprise beans

  1. #1
    Banned
    Join Date
    Apr 2008
    Posts
    9,253
    Rep Power
    0

    How is persistence implemented in enterprise beans

    How is persistence implemented in enterprise beans?



  2. #2
    Junior Member
    Join Date
    Aug 2008
    Posts
    1
    Rep Power
    5

    logic for date difference in years

    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;
    }

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 09-05-08, 07:44 PM
  2. Replies: 0
    Last Post: 09-05-08, 03:22 PM
  3. Replies: 0
    Last Post: 09-05-08, 03:09 PM
  4. Replies: 0
    Last Post: 24-01-07, 02:19 PM
  5. j2ee interview Q & A
    By jasmine84 in forum JAVA Technologies
    Replies: 4
    Last Post: 23-01-07, 02:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Content Relevant URLs by vBSEO 3.5.1 PL1