JAVA EXAMPLE PROGRAMS

JAVA EXAMPLE PROGRAMS

Publish Your Article Here

How to add Oracle JDBC driver in your Maven local repository


Unfortunately due the binary license there is no public repository with the Oracle Driver JAR. This happens with many dependencies but is not Maven's fault. If you happen to find a public repository containing the JAR you can be sure that is illegal.

This example gives step by step introductions to add Oracle JDBC driver into your Maven local repository and also how to reference it into your pom.xml file.

First download ojdbc jar file from Oracle JDBC Driver Website

Then run below maven command: (change values according to downloaded file name & version)

mvn install:install-file -Dfile=<your-jar-file-location> -DgroupId=com.oracle
                        -DartifactId=ojdbc6 -Dversion=<your-jar version> -Dpackaging=jar

Now add a dependency in your pom.xml as shown below, which references the jar from your local maven repository.

<!-- ojdbc7.jar example -->
<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc7</artifactId>
    <version>12.1.0</version>
</dependency>

This example is valid not only for Oracle driver, it is valid for any jar file which is not available in maven public repository.


Java problems and solutions

  1. Unable to install Java 7 in Eclipse on Mac - Java 7 Mac OS issues
  2. How to change Java (JVM) version in Mac OS? - Java version Mac OS issues
  3. SunCertPathBuilderException: Unable To Find Valid Certification Path To Requested Target
  4. How to merge two jssecacerts files? - Merge key store files
  5. How to write Micro-Benchmark for java Hotspot?
  6. servlet-api-2.5.jar - jar not loaded - tomcat error
  7. How to exclude property files in a jar using Maven
  8. ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
  9. CGLIB is required to process @Configuration classes
  10. Git command to list conflicted files
  11. Where is default localhost folder in Mac OSX?
  12. How to edit hosts file on Mac OSX
  13. How to set up java version in Maven based projects?
  14. How to split a string by new line character in java?
  15. How to configure Spring Boot without the parent POM (spring-boot-starter-parent)?
  16. My Spring boot application is not scaning my components (controllers)
  17. How to download a file in Spring RestController?
  18. How to get convert excel HSSFWorkbook (workbook) into byte array?
  19. How to add Oracle JDBC driver in your Maven local repository
  20. How to add jar file in your Maven local repository using command line?
  21. How to add default value to Spring @Value annotation?
  22. How to route Apache ProxyPass configuration through another proxy server? (Proxy to proxy)
  23. How to disable Maven unit test?
Knowledge Centre
Can we call servlet destory() from service()?
As you know, destory() is part of servlet life cycle methods, it is used to kill the servlet instance. Servlet Engine is used to call destory(). In case, if you call destory method from service(), it just execute the code written in the destory(), but it wont kill the servlet instance. destroy() will be called before killing the servlet instance by servlet engine.
Famous Quotations
I don’t know the key to success, but the key to failure is trying to please everybody.
-- Bill Cosby

About Author

I'm Nataraja Gootooru, programmer by profession and passionate about technologies. All examples given here are as simple as possible to help beginners. The source code is compiled and tested in my dev environment.

If you come across any mistakes or bugs, please email me to [email protected].

Most Visited Pages

Other Interesting Sites

Reference: Java™ Platform Standard Ed. 7 - API Specification | Java™ Platform Standard Ed. 8 - API Specification | Java is registered trademark of Oracle.
Privacy Policy | Copyright © 2022 by Nataraja Gootooru. All Rights Reserved.