aspose file tools*
The moose likes JDBC 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
JavaRanch » Java Forums » Databases » JDBC
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: 61603
    
  67

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: 61603
    
  67

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?