1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

unique customer id

Discussion in 'Java' started by spongeBob, Oct 22, 2010.

  1. spongeBob

    spongeBob New Member

    Joined:
    Oct 22, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I want to generate a unique id for customers in java, the customer id will take 2 alphabets from country Name (i.e. Australia- AU and America- AM), then pick 2 last digits of year (i.e. 2010- 10) finally I want a counter that can provide me number in a series like 0001, 0002,0003… Now the problem is I am not finding a way to save the last number that was assigned to a customer before closing the application, because every time I restart the application it moves back to -0000. :undecided
     
  2. virxen

    virxen New Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    0
    use a file and store the last value used
    when you start your app read this value
     
  3. spongeBob

    spongeBob New Member

    Joined:
    Oct 22, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Thanks it worked for me
     

Share This Page