aspose file tools*
The moose likes JDBC and the fly likes Curious Question relating username and password... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Curious Question relating username and password..." Watch "Curious Question relating username and password..." New topic
Author

Curious Question relating username and password...

Philip Zac
Ranch Hand

Joined: Apr 27, 2008
Posts: 66
Hello all,

I just have a curious question that comes to my mind.

Is it possible to have two members ( or users ) having the same username but different passwords.

say,

username for user1 and user2 is "apple".

but the password for user1 is "orange" and password for user2 is "pineapple".

Is it possible??? Are they allowed to have them???

Thanks in advanced.

Philip
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Philip Zac wrote:Is it possible to have two members ( or users ) having the same username but different passwords.

What would you think ? What If your JR user name(login) is same like mine, say "philip", then whose post/account/PM the JR is supposed to show ?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
Not sure. Don't think so, no, however.
Philip Zac
Ranch Hand

Joined: Apr 27, 2008
Posts: 66
Thanks Sagar and Campbell,

I thought there should be something to compare the username and password for a particular user. If there is same username, but different password, then it checks the comparsion of password and then assigned to that user.

Thanks

Philip
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Philip Zac wrote:If there is same username, but different password, then it checks the comparsion of password and then assigned to that user.

And what will happen, if both user sets the same password.

Philip ,
Consider, the username:password as "key:value" pair, and there shouldn't be any duplicate key.
Philip Zac
Ranch Hand

Joined: Apr 27, 2008
Posts: 66
Thanks Sagar ... Got it..

Philip
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

My Pleasure
Abhik Ghosh
Ranch Hand

Joined: Feb 28, 2008
Posts: 32
No, I think you have to make the username and password both unique. you can do it by comparing the new entered username and password both unique by comparing with the existing ones by using the compareToIgnoreCase function in a loop.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2510
    
  10

Abhik Ghosh wrote:No, I think you have to make the username and password both unique. you can do it by comparing the new entered username and password both unique by comparing with the existing ones by using the compareToIgnoreCase function in a loop.
In most databases, the password is stored as a hashed value. No way you can compare them. If two users use the same password, their password will not appear the same in a decent database.


OCUP UML fundamental and ITIL foundation
youtube channel
Abhik Ghosh
Ranch Hand

Joined: Feb 28, 2008
Posts: 32
thanks jan, you are right.. so we only make the username unique..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Curious Question relating username and password...