티스토리 뷰
How to add Oracle JDBC driver in your Maven local repository
Here’s a guide to show you how to add an Oracle JDBC driver into your Maven local repository, and also how to reference it in pom.xml
.
Due to Oracle license restrictions, the Oracle JDBC driver is not available in the public Maven repository. To use the Oracle JDBC driver with Maven, you have to download and install it manually into your Maven local repository.
1. Get Oracle JDBC Driver
Two ways to get the Oracle jdbc driver :
1.1. Visit Oracle website to get the Oracle JDBC driver – ojdbc6.jar
or ojdbc7.jar
1.2. Not recommend, but you can get the JDBC driver from the Oracle database installed folder, for example – {ORACLE_HOME}\jdbc\lib\ojdbc6.jar
2. Maven Install
To install the Oracle jdbc drivers :
2.1 ojdbc6.jar
$ mvn install:install-file -Dfile={Path/to/your/ojdbc6.jar}
-DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar
2.2 ojdbc7.jar
$ mvn install:install-file -Dfile={Path/to/your/ojdbc7.jar}
-DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar
Full example to install a ojdbc7.jar
> mvn install:install-file -Dfile=C:\\OracleJDBC\\ojdbc7.jar
-DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
[INFO] Installing C:\OracleJDBC\ojdbc7.jar to C:\Users\mkyong\.m2\repository\com\oracle\ojdbc7\12.1.0\ojdbc7-12.1.0.jar
[INFO] Installing C:\Users\mkyong\AppData\Local\Temp\mvninstall2095378400735903278.pom
to C:\Users\mkyong\.m2\repository\com\oracle\ojdbc7\12.1.0\ojdbc7-12.1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.332 s
[INFO] Finished at: 2017-02-13T21:26:03+08:00
[INFO] Final Memory: 8M/309M
[INFO] ------------------------------------------------------------------------
Done.
3. pom.xml
<dependencies>
<!-- ojdbc6.jar example -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
</dependency>
<!-- ojdbc7.jar example -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0</version>
</dependency>
</dependencies>
References
출처 : https://www.mkyong.com/maven/how-to-add-oracle-jdbc-driver-in-your-maven-local-repository/
---------------------그이외------------------------------------
DataConfig.java basicDataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver"); db.properties.xml dev.main.url=jdbc:oracle:thin:@220.XXX.XXX.XXX:1521:SID
mvn install:install-file -Dfile=C:\\WorkSpace\\BADoS\\src\\main\\webapp\\lib\\ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar
'program' 카테고리의 다른 글
12 Best Charting Libraries for Web Developers (big data graph 조사 자료 1) (0) | 2018.07.20 |
---|---|
squirrel sql client (altibase) setting (0) | 2018.07.16 |
JAVASCRIPT 접속 IP 확인하는 방법 (0) | 2017.06.13 |
text slider jquery example (0) | 2017.05.31 |
php 날짜 관련 처리 (0) | 2017.05.13 |