Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1.  
  2. import java.sql.Connection;
  3. import java.sql.DriverManager;
  4.  
  5. public class TestJdbc {
  6.  
  7. public static void main(String[] args) {
  8.  
  9. String jdbcUrl = "jdbc:mysql://localhost:3306/hb_student_tracker?useSSL=false";
  10. String user = "root";
  11. String pass = "root";
  12.  
  13. try {
  14. System.out.println("Connecting to database: " + jdbcUrl);
  15.  
  16. Connection myConn =
  17. DriverManager.getConnection(jdbcUrl, user, pass);
  18.  
  19. System.out.println("Connection successful!!!");
  20.  
  21. }
  22. catch (Exception exc) {
  23. exc.printStackTrace();
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement