Advertisement
Guest User

Untitled

a guest
Mar 16th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. package nkotb;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. public class Connect {
  8.  
  9. String url = "jdbc:mysql://localhost:3306/nkotb";
  10. String user = "root";
  11. String password = "1337";
  12. Connection conn = null;
  13.  
  14. public void Connection() {
  15. try {
  16. //1. Anslutning till mysql
  17. conn = DriverManager.getConnection(url, user, password);
  18. } catch (SQLException exc) {
  19. System.out.println(exc.getMessage());
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement