Advertisement
Guest User

Untitled

a guest
May 2nd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public DatabaseServiceImpl(){
  2.  
  3. try {
  4. Class.forName("oracle.jdbc.driver.OracleDriver");
  5. connection = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "student", "STUDENT");
  6.  
  7. System.out.println("================================");
  8. System.out.println(" CONNECTED TO ORACLE DATABASE ");
  9. System.out.println("================================");
  10. }
  11. catch (ClassNotFoundException e){
  12. System.err.println("FATAL ERROR: " + e.getMessage());
  13. }
  14. catch (SQLException e){
  15. System.err.println("DATABASE ERROR: " + e.getMessage());
  16. }
  17. }
  18.  
  19.  
  20. ========================================================
  21.  
  22.  
  23.  
  24. <dependency>
  25. <groupId>com.oracle</groupId>
  26. <artifactId>ojdbc6</artifactId>
  27. <version>11.2.0</version>
  28. </dependency>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement