Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This compliant solution reads the user name and password from a configuration file present in a secure directory.

Code Block
bgColor#ccccff
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);
}

...