I submitted my application EAR to Veracode Security scanning tool and got this flaw in the below piece of code :
private String url = "jdbc:mysql://localhost:8081/sql";
private String userName = "xyz";
private String password = "abc";
DriverManager.getConnection(url, user, password); // At this line i am getting this flaw.
Someone please help me on how to resolve CWE-259: Use of Hard-coded Password Flaw.