This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes How to get a String randomly? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to get a String randomly?" Watch "How to get a String randomly?" New topic
Author

How to get a String randomly?

Kidd y.Chen
Greenhorn

Joined: Jun 14, 2005
Posts: 2
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

Joined: Jan 10, 2002
Posts: 63053
    
  69

Moved to the JDBC forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63053
    
  69

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

Joined: Jun 14, 2005
Posts: 2
That's nice advice, I'll try by myself first, thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get a String randomly?
 
It's not a secret anymore!