SHARE
TWEET

Untitled

a guest Aug 12th, 2016 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class DBUtil {
  2.     private static final String URL = "jdbc:mysql://192.168.0.1:3306/enrollmentdb";
  3.     private static final String USERNAME = "root";
  4.     private static final String PASSWORD = "";
  5.  
  6.      public static Connection getConnection(DBType dbType) throws SQLException
  7.      {
  8.          return DriverManager.getConnection(URL, USERNAME, PASSWORD);
  9.      }
  10.  
  11.      public static void processException(SQLException ex){
  12.          System.err.println("Error message: "+ex.getMessage());
  13.          System.err.println("Error code: "+ex.getErrorCode());
  14.          System.err.println("SQL State: "+ex.getSQLState());
  15.      }
  16. }
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