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.

20th Sep 2018, 5:28 PM
Abdul Hamid
Abdul Hamid - avatar
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;
21st Sep 2018, 11:34 PM
Amir Ahmad
Amir Ahmad - avatar
+ 2
it is very simple var1 = AL-HPS-; var2 = random number; var randomKey = var1+var2;
23rd Sep 2018, 12:41 AM
Amir Ahmad
Amir Ahmad - avatar
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..
22nd Sep 2018, 5:47 PM
Abdul Hamid
Abdul Hamid - avatar
0
Let me try.
23rd Sep 2018, 6:45 AM
Abdul Hamid
Abdul Hamid - avatar