Guest User

Untitled

a guest
Feb 19th, 2019
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. package dbUtil;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. public class dbConnection {
  8.  
  9.     private static final String USERNAME = "haccptem_admin";
  10.     private static final String PASSWORD = "Slawo1995";
  11.     private static final String SQCONN = "jdbc:mysql://185.24.218.5:3306/haccptem_1";
  12.  
  13.     public static Connection getConnection() throws SQLException {
  14.  
  15.         System.out.println("     Database user:    " + USERNAME);
  16.         System.out.println(" Database password:    " + PASSWORD);
  17.         System.out.println("      Database URL:    " + SQCONN);
  18.         System.out.println("            ------- Data are correct ---------");
  19.         System.out.println("===========================================");
  20.         System.out.println("          DATABASE CONNECTED    ");
  21.  
  22.         return DriverManager.getConnection(SQCONN, USERNAME, PASSWORD);
  23.     }
  24.     }
Add Comment
Please, Sign In to add comment