daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Apr 20th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class DBConfig {
  2.  
  3. private static final String DRIVER_CLASS_NAME = "com.mysql.jdbc.Driver";
  4. private static final String CONN_STRING = "jdbc:mysql://localhost:3306/demo";
  5. private static final String USER = "root";
  6. private static final String PASSWORD = "1234";
  7.  
  8. private static Connection conn;
  9.  
  10. static Connection getConnection() throws ClassNotFoundException, SQLException {
  11.  
  12.     Class.forName(DRIVER_CLASS_NAME);
  13.     conn = DriverManager.getConnection(CONN_STRING, USER, PASSWORD);
  14.     return conn;
  15.  
  16.     }
  17.  
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top