Advertisement
Guest User

Untitled

a guest
Apr 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. public class OracleCon {
  2.     private Connection conn = null;
  3.     public OracleCon(){
  4.         try {
  5.             Class.forName("oracle.jdbc.driver.OracleDriver");
  6.             conn = DriverManager.getConnection("jdbc:oracle:thin:@//localhost:1521/xe", "kp", "03031994");
  7.         } catch (ClassNotFoundException classNotFoundEx) {
  8.            
  9.         } catch (SQLException sqlEx){
  10.            
  11.         }
  12.     }
  13.     public Connection getConnection() {
  14.         return this.conn;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement