Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public static void connect() throws SQLException,ClassNotFoundException{
  2.  
  3. Class.forName("com.mysql.jdbc.Driver");
  4. connection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database + username + pasword);
  5.  
  6. statement = connection.createStatement();
  7.  
  8. /*if(connection != null && !connection.isClosed()){
  9. return;
  10. }
  11. synchronized (Core.getInstance()){
  12. if(connection !=null && !connection.isClosed()){
  13. return;
  14. }
  15. }
  16. */
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement