...
This compliant solution reads the user name and password from a configuration file present in a secure directory.
Code Block | ||
---|---|---|
| ||
public final Connection getConnection() throws SQLException { // Username and password are read at runtime from a secure config file public final Connection getConnection() throws SQLException { return DriverManager.getConnection("jdbc:mysql://localhost/dbName", username, password); } |
...