Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get a String randomly?

 
Kidd y.Chen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just learned some basic knowledge about jsp&MySql, so I tried my best to do some practice. I designed a login system, and in my register_users table in database, there is one column which is String type, called ru_id, storing value to every register users, so the value in the column should be created automatically and can't not be the same in two of them.

So I want to know how randomly to get the only one String value, in restrict length, during registration in my this login system. Thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64973
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JDBC forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64973
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it have to be a string? Frequently, database sequences are used to generate unique numeric values for use as primary keys.
 
Kidd y.Chen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's nice advice, I'll try by myself first, thank you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic