Advertisement
Guest User

Untitled

a guest
Apr 28th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1.     private static Connection getConnection(String username, String pw) {
  2.  
  3.         Connection con = null;
  4.         try {
  5.             Class.forName("oracle.jdbc.driver.OracleDriver");
  6.             con = DriverManager.getConnection(
  7.                     "jdbc:oracle:thin:@datdb.cphbusiness.dk:1521:dat", username, pw);
  8.         } catch (SQLException ex) {
  9.             System.out.println("[HELPER CLASS] SQL ERROR: " + ex.getMessage());
  10.         } catch (ClassNotFoundException cnfe) {
  11.             System.out.println("[HELPER CLASS] ClASSNOTFOUND ERROR: "
  12.                     + cnfe.getMessage());
  13.         }
  14.  
  15.         return con;
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement