I am having a problem changing my user password when the password contains a char question mark. I have not encountered this problem with any other char so far, it seems specific to the char question mark.
If I change the user password in sqlplus using the following sql:
Alter user Stephen identifed by "NewPassword?" REPLACE "OldPassword";
Then it successfully changes the pass, and I can log in using the new pass "NewPassword?" .
However, if I execute the same SQL via jdbc:
final String query = "ALTER user Stephen identified by \"NewPassword?\" REPLACE \"OldPassword\"";
stmt.executeUpdate(query);
Then I cannot log in using the "NewPassword?" .
Checking the hash codes for the password when entering through sqlplus and jdbc shows that they are different. Somehow, when I run the statement in jdbc, it enters something other than "NewPassword?" .
I have no problems with the following passwords: NewPassword, NewPassword \, NewPassword '. This is just a question that causes problems.
Debugging shows that the code point (dec) is 63 for the question mark, so it does not look like it is changing halfway.
Does anyone know what might cause this behavior? I am now at a loss, I am considering the possibility of preventing omissions with question marks in order to get around this problem at the moment.
source share