Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. String host = "localhost";
  2. String database = "minecraft";
  3. String user = "root";
  4. String pass = "";
  5. String port = "3306";
  6.  
  7. private static Connection connection;
  8.  
  9. public synchronized void openConnection() {
  10. try {
  11. connection = DriverManager.getConnection("jdbc:mysql://" +host + ":3306/" + database, user, pass);
  12. System.out.println("[PETS] Successfully connected to MySQL Database!");
  13. } catch (SQLException e) {
  14. e.printStackTrace();
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement