|
hi to all,
im developer involved in a application calld security request system.here i need to generate a no. like ads234 as a token for each user who created a security request n also i need to increment it each time when a user made a request.pls help regarding this as soon as possible
|
|
|
Hi,
Try with this sample logic, Use rand class to generate some characters, and add numeric fields....
while (true) {
// if username is not unique, keep adding numbers to end until it is
//DB checking for User ID existing or not
if (!UserDAO.isThereDuplicateUsernameForId(newUserName)) {
break;
}
else {
newUserName = userName + Integer.toString(++index);
}
}
|
|
|
Hi,
thx for the reply.its really helpful thanku very much.it sloved a peice of puzzele im facing.
|
|
|
|
|
|
|
|