springboot 連接oracle 找不到oracle.jdbc.driver.OracleDriver

由於maven倉庫中沒有oracle.jdbc的poi,所以引入

<!-- https://mvnrepository.com/artifact/com.oracle/ojdbc6 -->
<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.4.0-atlassian-hosted</version>
    <scope>test</scope>
</dependency>

這個是無效,需要將其jar包下載下來,自己添加到本地maven倉庫

 下以後,安裝格式:

mvn install:install-file    -Dfile=<path-to-file>    -DgroupId=<group-id>     -DartifactId=<artifact-id>    -Dversion=<version>- Dpackaging=<packaging>

樣例:mvn install:install-file -DgroupId="com.oracle"  "-DartifactId=ojdbc6"  "-Dversion=12.2.0.4.0" "-Dpackaging=jar" "     -Dfile=D:\program\apache-maven-3.5.3\localRepository\11.2.0.4.0-atlassian-hosted.jar"

Dfile:你本地jar包所在的路徑。

安裝完畢,項目中引入

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

即可!!

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章