Advertisement
Guest User

Untitled

a guest
Mar 10th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. public void MySQL() {
  2.  
  3. try {
  4.  
  5. String HOSTNAME = "185.62.39.10";
  6. String PORT = "3306";
  7. String DATABASE = "db_1";
  8. String USERNAME = "db_1";
  9. String PASSWORD = "785c9d21bc";
  10. MySQL getConnection = new MySQL(HOSTNAME, PORT, DATABASE, USERNAME, PASSWORD);
  11.  
  12. try {
  13.  
  14. c = getConnection.openConnection();
  15. } catch (Exception e) {
  16. Bukkit.getConsoleSender().sendMessage(
  17. "[MineCrave Enchants Configuration] Please input your MySQL Information in the config.yml and restart the server or plugin.");
  18. }
  19.  
  20. try {
  21. Statement s = Main.c.createStatement();
  22. s.executeUpdate("create table if not exists playerdata ( "
  23. + " uuid VARCHAR(50), name VARCHAR(50), "
  24. + " tokens INT )");
  25. } catch (SQLException e) {
  26. Bukkit.getConsoleSender().sendMessage(
  27. " There is an error creating the table in your database. Please check your MySQL Information in the config.yml to see if it is correct.");
  28. }
  29.  
  30. } catch (NullPointerException e) {
  31.  
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement