I have DB2 table which has a column holding encrypted passwords of data type VARCHAR FOR BIT DATA
i am able to store the password in this column using DB2 encrypt() function,so far so good,the trouble is when i try to read that password back using DB2 decrypt_char()
function,i am trying to do that using a Named Native SQL Query like the one below
SELECT decrypt_char(TEMP_PASSWORD)
FROM <table name>
WHERE LCASE(USER_EMAIL_ADDRESS) = :emailId
this gives me an exception and i am only posting the lines that are significant from the stack trace
Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
Caused by: com.ibm.db2.jcc.b.SqlException: [ibm][db2][jcc][10150][10300] Invalid parameter: Unknown column name TEMP_PASSWORD.
i dont understand why,because not only is the column in present in the table but also the mapping is perfect in the hbm.xml
btw i am using a
JDBC Type 4 driver and DB2 V9
any help would be great