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

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

select * from v$version;

查询返回如下信息

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0    Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
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 文件中添加如下配置

<dependency>
  <groupId>com.oracle</groupId>
  <artifactId>ojdbc6</artifactId>
  <version>11.2.0.1.0</version>
</dependency>

  

posted @ 2013-10-11 16:10  Bruce.Chang.Lee  阅读(771)  评论(0)    收藏  举报