Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

how to encode a password

843811Apr 22 2008 — edited Apr 24 2008
Hi to all,
I've a username(JTextField) and password(JPasswordField),in that i'm entering the username and password and storing in the database(MySql).while storing the username is storing as it is but the password is stored in some encoded values.
user = rs.getString("username"); //Storing UserName.
pass=rs.getString("password");
String actualPass=new String(pass);
System.out.println(actualPass);
System.out.println(pass);
the o/p for the above println is

[C@1ab28fe
[C@1ab28fe

actualPass is " ramesh "
Now my question is, how to convert the password which is " [C@1ab28fe " into " ramesh " Then only i'll check the password with the database password

{code}
if (userText.getText().equals(user) && password.equals(actualPass))// i can't check like ramesh.equals([C@1ab28fe)
{code}

Help me plz..
Thanks in Advance..

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 22 2008
Added on Apr 22 2008
12 comments
390 views