Results 1 to 2 of 2
  1. #1
    bankTechy is offline Member
    Join Date
    Sep 2013
    Rep Power

    Default Generating a unique Serial Key in java

    i am writing an application which calculates the depreciation of an asset. Now i want to identify each asset with a unique serial key in java based on these table conditions in mysql.

    Java Code:
    Description         Description_Code       
    ---------------      ---------------- 
    Lands & Building          LB(001) 
     Branch_Area           Branch_Code 
    ------------          ------------- 
    Labone                     LB(001)
    i want to generate my serial number based on a default FC/ +Branch_Code/+Description_Code
    example is FC/LB/100/LB/001
    Any directions or help will be appreciated THANK YOU

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Northern Virginia, United States
    Rep Power

    Default Re: Generating a unique Serial Key in java

    Assuming that the combination of the various identifiers provides unique identification, this is just a simple string concatenation. Check out StringBuilder in the JDK API. This assumes there are no constraints imposed by the database.

    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Replies: 3
    Last Post: 07-01-2011, 02:05 PM
  2. Serial communication via ethernet-serial hub
    By Idiodyssey in forum New To Java
    Replies: 0
    Last Post: 05-04-2011, 02:23 PM
  3. How to make element unique in Java Collection
    By jeanjiang in forum New To Java
    Replies: 2
    Last Post: 04-25-2011, 11:53 AM
  4. Replies: 1
    Last Post: 07-30-2010, 08:29 AM
  5. generating trigger using java
    By money3 in forum JDBC
    Replies: 1
    Last Post: 10-06-2009, 11:56 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