Guest User

Untitled

a guest
Feb 5th, 2017
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. package net.oasya.API;
  2.  
  3. import org.bukkit.entity.Player;
  4. import org.bukkit.event.EventHandler;
  5. import org.bukkit.event.Listener;
  6. import org.bukkit.event.player.PlayerJoinEvent;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. import net.oasya.API.SQL.SqlConnection;
  10.  
  11. public class Main extends JavaPlugin implements Listener {
  12.  
  13. public SqlConnection sql;
  14.  
  15. public void onEnable() {
  16. sql = new SqlConnection("jdbc:mysql://","localhost","oasya","root","loltuserajamais");
  17. sql.connection();
  18. getServer().getPluginManager().registerEvents(this, this);
  19. }
  20.  
  21. public void onDisable() {
  22. sql.disconnect();
  23. }
  24.  
  25. @EventHandler
  26. public void join(PlayerJoinEvent e) {
  27. Player p = e.getPlayer();
  28. sql.createAccount(p);
  29. }
  30. }
Add Comment
Please, Sign In to add comment