0
How to generate unique key in textfield in java.
how i generate unique key like this AL-HPS-01 in the textfield and then save it in mysql database.
4 odpowiedzi
+ 3
generate a random key and then check if key is exists then regenerate a random key
update:
it is very simple
var1 = AL-HPS-;
var2 = random number;
var randomKey = var1+var2;
+ 2
it is very simple
var1 = AL-HPS-;
var2 = random number;
var randomKey = var1+var2;
0
But the random key generate different number of key. But i want this type if i add first student to database then it generate e.g.
AL-HDS-001
For 2nd
AL-HDS-002
For 3rd
AL-HDS-003
continue..
0
Let me try.