Guest User

Untitled

a guest
Nov 29th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4.  
  5. /*
  6. * To change this license header, choose License Headers in Project Properties.
  7. * To change this template file, choose Tools | Templates
  8. * and open the template in the editor.
  9. */
  10. /**
  11. *
  12. * @author sohel1
  13. * @version 1.0
  14. * @since 1.0
  15. */
  16. public class DBUtility {
  17.  
  18. // I haven't added documentation comment, pls add it.
  19. private final String URL;
  20. private final String USERNAME;
  21. private final String PASSWORD;
  22.  
  23. public DBUtility(String URL, String USERNAME, String PASSWORD) {
  24. this.URL = URL;
  25. this.USERNAME = USERNAME;
  26. this.PASSWORD = PASSWORD;
  27. }
  28.  
  29. public Connection getConnection() throws SQLException {
  30. Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
  31. return connection;
  32. }
  33. }
Add Comment
Please, Sign In to add comment