Parameterizing value to be Encrypted in Query SQL

Asked

Viewed 34 times

0

Currently, the query query that returns results is as follows:

 SELECT nome, email, senha
 FROM Professor 
 WHERE email = ? AND senha = HASHBYTES('SHA1','" + senha + "') 

 p.setString(1, email);

When trying to parameterize the value within the HASHBYTES resource (with placeholder '?', in the Preparedstatement from Java), there is some read/type/conversion error that causes the query not to return results.

What would be the correct way to parameterize this Query, and then do the Binding with the value of the variable password?

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.