maven中本地安装oracle,sqlserver驱动的方法

maven中本地安装oracle,sqlserver驱动的方法

maven中本地安装oracle驱动的方法
下载地址:
https://download.csdn.net/download/hsg77/12231654

ojdbc6.jar

在dos环境中,本地安装命令如下:
mvn install:install-file -Dfile=E:\项目集合\svn\lib\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=6.0 -Dpackaging=jar -DgeneratePom=true

mvn install:install-file -Dfile=E:\项目集合\svn\lib\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=6.0 -Dpackaging=jar -DgeneratePom=true

执行结果为表示安装成功

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
[INFO] Installing E:\项目集合\svn\lib\ojdbc6.jar to D:\maven\repository\com\oracle\ojdbc6\6.0\ojdbc6-6.0.jar
[INFO] Installing C:\Users\hsg\AppData\Local\Temp\mvninstall687442432428537056.pom to D:\maven\repository\com\oracle\ojdbc6\6.0\ojdbc6-6.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.775 s
[INFO] Finished at: 2020-03-05T16:50:42+08:00
[INFO] ------------------------------------------------------------------------

maven项目中pom.xml引入依赖项为:

<!-- orcale驱动 -->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>6.0</version>
        </dependency>

maven中本地安装sqlserver驱动的方法
下载地址:sqljdbc4-3.0.jar
http://www.java2s.com/Code/Jar/s/Downloadsqljdbc430jar.htm

在dos环境中,本地安装命令如下:
mvn install:install-file -Dfile=E:\项目集合\svn\lib\sqljdbc4-3.0.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.3

mvn install:install-file -Dfile=E:\项目集合\svn\lib\sqljdbc4-3.0.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.3

执行结果如下为表示安装成功

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
[INFO] Installing E:\项目集合\svn\lib\sqljdbc4-3.0.jar to D:\maven\repository\com\microsoft\sqlserver\sqljdbc4\4.3\sqljdbc4-4.3.jar
[INFO] Installing C:\Users\hsg\AppData\Local\Temp\mvninstall7283894858734435635.pom to D:\maven\repository\com\microsoft\sqlserver\sqljdbc4\4.3\sqljdbc4-4.3.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.850 s
[INFO] Finished at: 2020-03-06T14:09:50+08:00
[INFO] ------------------------------------------------------------------------

maven项目中pom.xml引入依赖项为:

<!-- sqlserver驱动包 -->
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>sqljdbc4</artifactId>
            <version>4.3</version>
        </dependency>

另附其它关系数据库引入依赖项为:

<!--postgresql驱动包-->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.2.5</version>
        </dependency>
        <!--mysql驱动包-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.23</version>
        </dependency>
        <!--sqlite驱动包-->
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.7.2</version>
        </dependency>
        <!-- orcale驱动包 -->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>6.0</version>
        </dependency>
        <!-- sqlserver驱动包 -->
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>sqljdbc4</artifactId>
            <version>4.3</version>
        </dependency>

—the—end–

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页