File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Want to generate unique and continuous userid in jsp(servlets) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Want to generate unique and continuous userid in jsp(servlets)" Watch "Want to generate unique and continuous userid in jsp(servlets)" New topic
Author

Want to generate unique and continuous userid in jsp(servlets)

srs rss
Greenhorn

Joined: Feb 23, 2010
Posts: 1
Hai,
I'm new in jsp and servlets. So please help me...

i have a registration page in my project and want to generate unique and continous id
for every user so that they can log in with that id.

I just want the id to contain an alphabet with number (eg:-jk1234).
Is it possible to generate such kind of id for every users who got registered in my website??
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Didn't you find a much bolder font to post?
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Why not just using a regular number starting at 100000 or so ?


JDBCSupport - An easy to use, light-weight JDBC framework -
sagar powar
Greenhorn

Joined: Jan 13, 2010
Posts: 8
if registered users are going to be saved in database then you can use "User" table primary key i.e. userId.
When new user gets added into database; it's id will be max(userId)+1.

It depends how you implement !

SCJP 1.4 - 93%
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
sagar powar wrote:if registered users are going to be saved in database then you can use "User" table primary key i.e. userId.
When new user gets added into database; it's id will be max(userId)+1.

It depends how you implement !


The field can simply be set to AUTO_INCREMENT
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Want to generate unique and continuous userid in jsp(servlets)