Advertisement
Guest User

Untitled

a guest
Jan 19th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. If you do not have an oracle driver do steps 1 and 2 first. Otherwise skip to step 3.
  2.  
  3. 1) Download the jdbc driver from oracle.
  4.  
  5. 2) Install the driver into your local maven .m2 repository. Example:
  6.  
  7. mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.4 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true
  8.  
  9. In the above example the ojdbc6.jar version 11.2.0.4 is used. Replace the -DartifactId=ojdbc6 -Dversion=11.2.0.4 and -Dfile=ojdbc6.jar with the driver name/version you downloaded.
  10.  
  11. 3) Add the dependency to your build.gradle file. Example:
  12. dependencies {
  13. ...
  14. runtime("com.oracle:ojdbc6:11.2.0.4")
  15. ...
  16. }
  17.  
  18. replace driver name and version with the one you downloaded
  19.  
  20. 4) In spring boot add/modify the application.properties file to use your db url, username and password. Example:
  21.  
  22. spring.datasource.driverClassName=oracle.jdbc.driver.OracleDriver
  23. spring.datasource.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
  24.  
  25.  
  26. spring.datasource.username=username
  27. spring.datasource.password=secret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement