Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. package no.brisner.SQLTest;
  2.  
  3. import java.sql.*;
  4.  
  5. import java.util.HashMap;
  6. import java.util.logging.Level;
  7. import java.util.logging.Logger;
  8.  
  9. import org.bukkit.Server;
  10.  
  11. import org.bukkit.entity.Player;
  12. import org.bukkit.plugin.PluginDescriptionFile;
  13. import org.bukkit.plugin.PluginLoader;
  14. import org.bukkit.plugin.java.JavaPlugin;
  15.  
  16. /**
  17. * SQLTest for Bukkit
  18. *
  19. * @author arensirb
  20. */
  21. public class SQLTest extends JavaPlugin {
  22. public static final Logger log = Logger.getLogger("Minecraft");
  23. private final SQLTestPlayerListener playerListener = new SQLTestPlayerListener(this);
  24. private final SQLTestBlockListener blockListener = new SQLTestBlockListener(this);
  25. private final HashMap<Player, Boolean> debugees = new HashMap<Player, Boolean>();
  26.  
  27. public void onEnable() {
  28. // TODO: Place any custom initialisation code here
  29. try {
  30. Class.forName("com.mysql.jdbc.Driver");
  31. Connection conn = DriverManager.getConnection("jdbc:mysql://80.64.207.220/minecraft", "root", "xxxxxxx");
  32. if (conn == null) {
  33. log.log(Level.SEVERE,"Something went really wrong!");
  34. } else {
  35. log.log(Level.SEVERE,"Something went extremely well!");
  36. try {
  37. conn.close();
  38. } catch (SQLException e) {
  39. e.printStackTrace();
  40. }
  41. }
  42. } catch(SQLException e) {
  43.  
  44. }catch(Exception e) {
  45.  
  46. }
  47. // Register our events
  48. }
  49. public boolean isDebugging(final Player player) {
  50. if (debugees.containsKey(player)) {
  51. return debugees.get(player);
  52. } else {
  53. return false;
  54. }
  55. }
  56. public void onDisable() {
  57. // TODO: Place any custom disable code here
  58.  
  59. // NOTE: All registered events are automatically unregistered when a plugin is disabled
  60.  
  61. // EXAMPLE: Custom code, here we just output some info so we can check all is well
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement