Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public void openConnection() throws SQLException, ClassNotFoundException {
  2. if (c != null && !c.isClosed()) {
  3. return;
  4. }
  5. synchronized (this) {
  6. if (c != null && !c.isClosed()) {
  7. return;
  8. }
  9. Class.forName("com.mysql.jdbc.Driver");
  10. c = DriverManager.getConnection("jdbc:mysql://" + MSPMain.host+ ":" + MSPMain.port + "/" + MSPMain.database, MSPMain.username, MSPMain.password);
  11. }
  12. }
  13. try {
  14. openConnection();
  15. }
  16. catch (SQLException e) {
  17. console.sendMessage(prefix+"Error creating default table `players`:");
  18. console.sendMessage(e.getMessage());
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement