How to load Oracle driver ____oracle in MAVEN project

Source: Internet
Author: User

Because of Oracle commercial copyright issues, MAVEN cannot download jar packages directly through the central repository, and if you want to use jar packs, you need to manually process them.

Step One: Place the Ojdbc14.jar in the user's directory, such as: C:\Users\qicyt1812

Step Two: Execute the command in cmd: mvn install:install-file-dgroupid=com.oracle-dartifactid=ojdbc14-dversion=10.2.0.1.0- Dpackaging=jar-dfile=ojdbc14.jar

C:\USERS\QICYT1812>MVN install:install-file-dgroupid=com.oracle-dartifactid=ojdbc14-dversion=10.2.0.1.0- Dpackaging=jar-dfile=ojdbc14.jar
This installs the JDBC driver into Maven's local repository, which indicates that the installation was successful when the following code appeared in the cmd command.

C:\USERS\QICYT1812>MVN INSTALL:INSTALL-FILE-DGROUPID=COM.ORACLE-DARTIFACTID=OJDBC1
4-dversion=10.2.0.1.0-dpackaging=jar-dfile=ojdbc14.jar
[INFO] Scanning for projects ...
[INFO]
[INFO]------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO]------------------------------------------------------------------------
[INFO]
[INFO]---maven-install-plugin:2.3.1:install-file (default-cli) @ Standalone-po
M---
[INFO] Installing C:\Users\qicyt1812\ojdbc14.jar to D:\eclipse\apache-maven-local-re
Pository\com\oracle\ojdbc14\10.2.0.1.0\ojdbc14-10.2.0.1.0.jar
[INFO]------------------------------------------------------------------------
[INFO]Build SUCCESS
[INFO]------------------------------------------------------------------------
[INFO] Total time:1.100s
[INFO] Finished At:fri Oct 14:24:18 CST 2013
[INFO] Final memory:6m/53m
[INFO]------------------------------------------------------------------------
Enter D:\eclipse\apache-maven-local-repository\com\oracle\ojdbc14\10.2.0.1.0\ view, successfully install to local



Step Three: Add dependency to the pom.xml of the required project

<!--load Oracel JDBC Driver package-->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.1.0</version>
</dependency>

With the above steps, Oracle driver can be used.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.