I have a simple Java app that suddenly stopped connecting to a local DB2 database, citing an incorrect password as the cause. The database authenticates with the Windows user credentials. I was using a password that contained a semicolon and some parentheses, and when I changed this to something simpler, the app was able to connect again.
My question is: is there any way in which these characters in the password could have been causing a login failure?
The exception was: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] SQL30082N Security processing failed with reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001
And the connection code looks like:
String username = "username";
String password = "pass;w(ord)";
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
db2Connection = DriverManager.getConnection("jdbc:db2:DBNAME", username, password);
Where a DB2 password contains special characters it needs to be quoted in the connection string.
Try changing your
passwordvariable to: