• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

login (upper and lower letter case)

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how can i conside the upper letter and lower letter case when the user use the user id to login.
it is because when the user table have the user id is 'AM'
when the user type lower letter 'am' that i can login to the system.

how can i match the letter that exactly same as the database then let user login.


if(am==AM),then can't login
if(Am==AM),then can't login.

if(AM==AM),then login
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I suppose that user name is string.
It means that String is an object, not primitive (primitives start with lower case letter - int, boolean etc., classes start with upper case letter - String, Integer etc.)
"==" is used to compare primitive values, not objects.
So check the String api and you'll find out the right way to compare
two strings (of objects) plus other very useful methods that can help you.
 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suppose dbuser is the String you get from your database and user the String the user types to log in



tests whether dbuser and user have the same value or not,

if dbuser = "AM"

and user = "am" (or "Am" or "aM")

dbuser.equals(user) returns false

but if user = "AM" it returns true


 
Li Jenny
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic