Guest User

Untitled

a guest
Jan 12th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. package sfgbot;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5.  
  6. public class DatabaseCon {
  7.  
  8.  
  9. public static void makeCon() {
  10.  
  11. try {
  12.  
  13. Connection conn;
  14.  
  15. // *** Make connection with the database
  16. Class.forName("com.mysql.jdbc.Driver").newInstance();
  17. String url = "jdbc:mysql://127.0.0.1:3306/sfgbot";
  18. conn = DriverManager.getConnection(url, "root", "AtserBV");
  19.  
  20. } catch(Exception e) {
  21. e.printStackTrace();
  22. }
  23. }
  24. }
Add Comment
Please, Sign In to add comment