Advertisement
Guest User

Untitled

a guest
Dec 31st, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. try {
  2.  
  3. synchronized (this) {
  4. if (getConnection() != null && !getConnection().isClosed()) {
  5. return;
  6. } else {
  7. Bukkit.getConsoleSender().sendMessage(cc("&4(!) &bEasyRegister now &cNot Connected &bto a database&f"));
  8. }
  9.  
  10. Class.forName("com.mysql.jdbc.Driver");
  11. setConnection(DriverManager.getConnection("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database, this.username, this.password));
  12.  
  13. Bukkit.getConsoleSender().sendMessage(cc("&4(!) &bEasyRegister now &aConnected &bto a database&f"));
  14. }
  15. } catch (SQLException e) {
  16. e.printStackTrace();
  17. } catch (ClassNotFoundException e) {
  18. e.printStackTrace();
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement