Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have two column that is id(varchar (16)) and password (char(10)). Now I want to call method for generating alphanumeric automatically and that should save in mysql..

Regards
Asha
Posted
Updated 13-Sep-11 0:12am
v3
Comments
Herman<T>.Instance 13-Sep-11 5:28am    
what have you tried?
TorstenH. 13-Sep-11 5:59am    
I added SQL and MySQL tag, this is hardly anything about Java.

You could try the Membership.GeneratePassword[^] method.

Or
C#
Guid.NewGuid().ToString()
 
Share this answer
 
v2
Comments
Pravin Patil, Mumbai 13-Sep-11 6:11am    
Good link....
...to get to the point with the random String:

Java
public String getRandom(int iLength) {
    UUID oID = UUID.randomUUID();
    String strRandom = oID.toString()
    return strRandom.substring(iLength);
}


returns a random String in a desired length.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900