• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
srs rss
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Didn't you find a much bolder font to post?
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just using a regular number starting at 100000 or so ?
 
sagar powar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic