ojdbc 추가

 

Get Oracle JDBC drivers and UCP from Oracle Maven Repository (without IDEs)

New !! Oracle 19.3 JDBC drivers and Universal Connection Pool (ucp.jar) are on Maven Central Repository !! Refer to the blog for more details.  The Oracle JDBC drivers and Universal Connection Pool (UCP) are also available on the Oracle Maven Repository. T

blogs.oracle.com

순서대로 진행해보자

1. 우선 메이븐 다운로드 페이지로 이동한다.

메이븐 다운로드 페이지 이동하기

 

Maven – Download Apache Maven

Downloading Apache Maven 3.6.3 Apache Maven 3.6.3 is the latest release and recommended version for all users. The currently selected download mirror is http://apache.mirror.cdnetworks.com/. If you encounter a problem with this mirror, please select anothe

maven.apache.org

maven을 다운받는다.

다운받은 파일을 압추을 풀어준 후 편하게 환경변수 등록을 하기 위해 C:\로 이동시킨다.

다음과 같이 Path를 편집한다.

변수값 제일 뒤에 아래의 변수 값을 추가한다.

C:\apache-maven-3.6.3\bin

 

cmd로 접속 후

다음과 같이 mvn -v 실행시 아래와 같이 버전이 정상적으로 나온다면 정상적으로 변수값 적용이 된 것이다.

확인 후 아래의 jar 파일을 로컬에 설치해줘야한다.

코드는 다음과 같다.

 

아래 오라클 jar 파일이 있는 경로를 확인한 후 아래 양식에 맞게 입력해준다.(PC마다 다를 수 있음)

 

 

mvn install:install-file -Dfile="파일이름(위치까지)" -DgroupId=그룹아이디 -DartifactId=파일이름 -Dversion=버전 -Dpackaging=jar


mvn install:install-file -Dfile=C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6g -Dversion=11.2.0 -Dpackaging=jar

 

cmd 창에서 입력해서 진행하자.

다음과 같이 입력 후 정상적으로 빌드되면 아래와 같은 메시지가 나온다.

아래와 같이 maven repository로 이동하면

우리가 설치한 jar 파일을 확인할 수 있다.

그럼 pom.xml에 추가해보도록하자.

현재 필자의 인텔리제이 프로젝트는 다음과 같이 dependency 오류가 있는 것을 확인할 수 있다.

아래와 같은 코드로 dependency를 수정한 후 다음과 같이 메이븐에 정상 추가된 것을 확인할 수 있다.

        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6g</artifactId>
            <version>11.2.0</version>
        </dependency>

만약 정상 추가가 안될 경우 아래와 같이 Update Maven indices를 진행하자

그리고 다음과 같이 모듈 셋팅의 아티팩트에서 해당 라이브러리를 추가해주면

다음과 같이 아웃풋 레이아웃에 추가된 걸 확인하고 OK를 눌러준다.

 

+ Recent posts