Skip to content

Instantly share code, notes, and snippets.

@luissilvazup
Last active June 17, 2020 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luissilvazup/e8223118d9a0dad5d4295bd3a89bae72 to your computer and use it in GitHub Desktop.
Save luissilvazup/e8223118d9a0dad5d4295bd3a89bae72 to your computer and use it in GitHub Desktop.
SRP Solution Part 1
public class S_SingleResponsabilitySolution {
private static class ConnectionDAO {
private Properties connectionProps;
private Connection conn;
private static final String URL = "jdbc:mysql://localhost:3306/employee?useSSL=false";
private ConnectionDAO(String username, String password) {
connectionProps = new Properties();
connectionProps.put("user", username);
connectionProps.put("password", password);
}
private Connection createConnection() {
//Cria conexão com o banco
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment