ClassNotFoundException: oracle.jdbc.OracleDriver

前端 未结 2 1152
既然无缘
既然无缘 2021-01-27 20:13

I want to use hibernate in my maven project. I added hibernate.cfg.xml and hibernate.reveng.xml to resources, also added hibernate and oracle drivers to pom.xml, but the problem

相关标签:
2条回答
  • 2021-01-27 20:39

    Ensure to add your ojdbc7.jar to your classpath.

    1.Add ojdbc7.jar to TOMCAT_HOME/lib
    2.Add ojdbc7.jar to JAVA_HOME/jre/lib
    3.Trying with ojdbc6.jar if it still not works
    
    0 讨论(0)
  • 2021-01-27 20:44

    The OJDBC driver is not available in maven central which is why maven fails to find it. You need to download it manually from the oracle homepage.

    Then you can either deploy it to a self hosted maven repository and add that repository to your pom or just add the jar file directly to your classpath.

    0 讨论(0)
提交回复
热议问题