Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3.  
  4. public class Greeting
  5. {
  6. private Connection connect = null;
  7.  
  8. public void readDB() throws Exception {
  9. {
  10. Class.forName("com.mysql.cj.jdbc.Driver");
  11.  
  12. if(DriverManager.getConnection("jdbc:mysql://localhost/todo?useLegacyDatetimeCode=false&serverTimeZone=UTC" + "&user=root&password=F%21%2351j1%5E31fn1%235") != null)
  13. {
  14. System.out.println("hello");
  15. }
  16. }
  17. catch (Exception e){
  18. throw e;
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement