将Oracle JDBC驱动库安装到本地仓库

 

 

1、为了添加详细版本信息,先查看当前Oracle数据库版本

1 select * from v$version;

查询返回如下信息

复制代码
1 BANNER
2 --------------------------------------------------------------------------------
3 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
4 PL/SQL Release 11.2.0.1.0 - Production
5 CORE    11.2.0.1.0    Production
6 TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
7 NLSRTL Version 11.2.0.1.0 - Production
复制代码

 

2、安装JAR包

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc5 -Dversion=11.2.0.1.0 -Dpackaging=jar -Dfile=%ORACLE_HOME%/jdbc/lib/ojdbc5.jar
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.1.0 -Dpackaging=jar -Dfile=%ORACLE_HOME%/jdbc/lib/ojdbc6.jar

 

3、现在本地仓库中就有了Oracle JDBC包,使用时,在pom.xml 文件中添加如下配置

1 <dependency>
2     <groupId>com.oracle</groupId>
3     <artifactId>ojdbc6</artifactId>
4     <version>11.2.0.1.0</version>
5 </dependency>
posted @ 2017-03-07 17:09  时光与你同在  阅读(1356)  评论(0编辑  收藏  举报