This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 60755
    
  65

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: 60755
    
  65

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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to get a String randomly?
 
Similar Threads
update database when session got invalidated
customer ID
getting column names from JDBC and display it in JTree
need to update logout details into database when client machine shutdown
JTable with different objects (or components) in a column