Guest User

Untitled

a guest
Oct 13th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public static void main(String[] args) {
  2. try
  3. {
  4. Class.forName("com.mysql.jdbc.Driver");
  5. }
  6. catch (ClassNotFoundException e)
  7. {
  8. e.printStackTrace();
  9. return;
  10. }
  11. try
  12. {
  13. Connection connection = DriverManager.getConnection("jdbc:mysql://192.168.105.101:3306/world", "root", "1997");
  14. Statement statement = connection.createStatement();
  15.  
  16. }
  17. catch(Exception e)
  18. {
  19. System.out.println("Connection Failed!");
  20. e.printStackTrace();
  21. return;
  22. }
  23. }
  24. }
Add Comment
Please, Sign In to add comment