Advertisement
Guest User

Untitled

a guest
Dec 28th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. package lu.r3flexi0n.bungeeonlinetime.database;
  2.  
  3. import java.sql.DriverManager;
  4.  
  5. public class MySQL
  6. extends SQL
  7. {
  8. private final String host;
  9. private final String database;
  10. private final String username;
  11. private final String password;
  12. private final int port;
  13.  
  14. public MySQL(String host, int port, String database, String username, String password)
  15. {
  16. this.host = host;
  17. this.port = port;
  18. this.database = database;
  19. this.username = username;
  20. this.password = password;
  21. }
  22.  
  23. public void openConnection()
  24. throws Exception
  25. {
  26. Class.forName("com.mysql.jdbc.Driver");
  27. setConnection(DriverManager.getConnection("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database, this.username, this.password));
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement