Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Java Mysql JDBC Problem with Decode

$
0
0
Hello all,

ok, so I have a database that was created about 10 years ago and it was done using encode/decode for the users passwords (which i know is not a good way to do it but it was loong ago and now I am stuck with it)

The problem is that I need to be able to access the encoded columns through java's JDBC and I cannot figure out how to do this.

I have the "encode code" that was used but I tried this:

String T = "SELECT *,DECODE(PassWord,'XX') as PassWord FROM AdminPW WHERE UserName='"+username+"'";



but it still returned as binary

I tried to return it using:
rs.getString(5)
rs.getBlob(5)



but it still is returning binary..

anyone know how to get the encoded column and decode it through JDBC?

I know this is Mysql but the problem doesnt seem to stem from MySql's end, more JDBC and how it pulls the data I am assuming..

also..
can anyone push me towards any docs on what the best way to save data that needs to be "cryptic" I would like to eventually update the database and make it more secure and flexible.

Thank you for any help
Bob

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>