SHARE
TWEET

Untitled

a guest Sep 11th, 2019 111 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package sample;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5.  
  6. public class ConConfig {
  7.     public static Connection getConnection()
  8.     {
  9.         Connection connection_object = null;
  10.         try
  11.         {
  12.             Class.forName("com.mysql.cj.jdbc.Driver");
  13.             final String url = "jdbc:mysql://localhost:3306/easynotes";
  14.             final String user = "root";
  15.             final String password = "admin";
  16.             connection_object = DriverManager.getConnection(url, user, password);
  17.         }
  18.         catch (Exception e)
  19.         {
  20.             e.printStackTrace();
  21.         }
  22.         return connection_object;
  23.     }
  24. }
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