• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

오라클을 해보고싶은데..

19.08.06 19:42 작성 조회수 179

0

안녕하세요..

제가 이전에 스프링부트가 아닌 기본 스프링만 배우고 스프링 레거시 프로젝트로만 배워서 이 강좌를 보고 있습니다.

다름이 아니라 제가 오라클을 많이 사용을해서 오라클도 연동을 해보려고 하는데 잘 안되더라구요,.

오라클은 11g xe 실습용을 사용하고 있습니다.

이 강의에서 datasource url과 classname을 오라클로 변경하고

dependency는 구글링해보았는데  글마다 좀 달라서  밑에처럼 추가했습니다.

<dependency>

   <groupId>com.zaxxer</groupId>

    <artifactId>HikariCP</artifactId>

</dependency>

<dependency>

      <groupId>com.oracle</groupId>

      <artifactId>ojdbc6</artifactId>

</dependency>

 

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pgSQLRunner': Unsatisfied dependency expressed through field 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: oracle.jdbc.OracleDriver

이러한 로그가떠서

spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver

spring.datasource.driver-class-name=oracle.jdbc.OracleDriver

이런식으로 변경해보았는데 계속 에러가 발생하더라구요.. 혹시 다른방법이 있는지 아니면 제가 잘못 하고 있는것이 무엇인지 알려 주실수 있을까요?? 감사합니다(_ _)

답변 1

답변을 작성해보세요.

0

[com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: oracle.jdbc.OracleDriver

오라클 JDBC 드라이버를 추가하셔야 합니다. 의존성을 잘못추가하신거에요. JDBC와 JDBC 드라이버 그리고 메이븐 의존성을 공부하세요.