1 23 24 package org.dbforms.util; 25 26 27 33 public class UniqueIDGenerator { 34 private static int counter = 0; 35 36 40 public static synchronized String getUniqueID() { 41 long first = new java.util.Date ().getTime(); 42 int second = (int) (Math.random() * 100); 43 counter++; 44 45 return Long.toString(first) + Integer.toString(second) 46 + Integer.toString(counter); 47 } 48 } 49 | Popular Tags |