Skip to Main Content

New to Java

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!

Decode MySQL using Java

843785Jan 23 2009 — edited Jan 23 2009
Hey guys,

I have been having problems trying to figure out how to decode MySQL passwords that i have setup on my table using Java so that when a user enters a password on the java application it will decode that password check if it is correctly used and then let them log in. Currently i am using NetBeans and my current checker for password and user name is

String sql = "SELECT * from user where userName LIKE '" + userName + "' and userPass LIKE '" + userPass + "'";

as you can see it has nothing to do with decoding.

I also know that to be able to decode on mysql it has to be done like this.

SELECT DECODE([table_column], 'encoded password') from [table name];

so for example here is where my current passwords are

SELECT DECODE(userPass, 'cross') from user;

also to make this a little easier so that it depicts the actual user

SELECT DECODE(userPass, 'cross') from user where userName = 'ian';

If anyone has any ideas that would be great. I also tried searching the forums and a lot of google but each time i find something it has to do with php or just encrypting anything on actual java.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2009
Added on Jan 23 2009
1 comment
373 views