I have table mm with field id,name and sal
I inserted encrypted value in the DB using the AES_ENCRYPT
psmt = con.prepareStatement("insert into mm values("+id+",AES_ENCRYPT('"+name+"','"+key+"'),AES_ENCRYPT('"+sal+"','"+key+"'))");
It is working properly
but when i am trying to retrieve these values using AES_DECRYPT
rs = st.executeQuery("select id,AES_DECRYPT(name,'"+key+"'),AES_DECRYPT(sal,'"+key+"') FROM mm WHERE id="+rs.getInt(1)+"");
When i am applying query on mysql console it work properly.
but when apply using java code it gives values like
| 1| [B@1f0690a| [B@803365 |
Why i am getting these values instead of the original values ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…