Results 1 to 7 of 7
  1. #1
    Pinky4Free is offline Member
    Join Date
    Nov 2012
    Posts
    15
    Rep Power
    0

    Default Having trouble with Java login from with mySQL


    As you guys can see in the image above, the first username provided through the MySQL server is in fact equal to the User Provided Username typed in the textbox, but for some reason, java still says they are not equal? Help me please!

  2. #2
    Pinky4Free is offline Member
    Join Date
    Nov 2012
    Posts
    15
    Rep Power
    0

    Default Java MySQL issues. Please HELP!


    As you guys can see in the image above, the first username provided through the MySQL server is in fact equal to the User Provided Username typed in the textbox, but for some reason, java still says they are not equal? Help me please!

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    11,604
    Blog Entries
    7
    Rep Power
    17

    Default Re: Java MySQL issues. Please HELP!

    Don't compare two Strings for equality with the == operator; use the String.equals( ... ) method instead.

    kind regards,

    Jos

    ps. this reply should be nailed to the front door of this forum.
    When people rob a bank they get a penalty; when banks rob people they get a bonus.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    10,094
    Rep Power
    17

    Default Re: Having trouble with Java login from with mySQL

    Compare Strings and other objects by using the .equals(...) method. Not by ==.

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    10,094
    Rep Power
    17

    Default Re: Having trouble with Java login from with mySQL

    Moved from Networking.

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    10,094
    Rep Power
    17

    Default Re: Having trouble with Java login from with mySQL

    Also, go through the Forum Rules -- particularly the second paragraph. I've merged your two threads here. Please don't double post the same question in future.

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

  7. #7
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,619
    Rep Power
    5

    Default Re: Having trouble with Java login from with mySQL


Similar Threads

  1. trouble installing mysql workbench
    By droidus in forum JDBC
    Replies: 13
    Last Post: 01-06-2012, 08:17 AM
  2. Trouble using JSP for MySQL database
    By killasaurus tex in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 04-13-2011, 06:39 AM
  3. mySQL login code??
    By sweet angle in forum JDBC
    Replies: 3
    Last Post: 10-20-2010, 09:42 AM
  4. JDBC and mySQL database trouble
    By ichwar in forum JDBC
    Replies: 17
    Last Post: 08-16-2010, 11:21 PM
  5. Login with mysql
    By fernando in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-07-2007, 03:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •