Advertisement
Guest User

Untitled

a guest
Nov 19th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public class Main {
  2.  
  3. private static final String URL = "jdbc:mysql://localhost:3306/mydbtest?useSSL=false";
  4. private static final String LOGIN = "root";
  5. private static final String PASSWORD = "root";
  6.  
  7. public static void main(String[] args) {
  8. Connection connection = null;
  9. try {
  10.  
  11. connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydbtest?useSSL=false", "root", "root");
  12. if(!connection.isClosed()){
  13. System.out.println("TRUE");
  14. }
  15. } catch (SQLException e) {
  16. System.err.println("Невозможно подлючиться к БД!");
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement