问题描述
- JDBC连接数据库,求大神帮解决啊,我怎么也解决不了了。。。
-
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at cpu.hrms.dao.DatabaseDao.getConnection(DatabaseDao.java:29)
at cpu.hrms.dao.impl.IEmployeeImpl.isLogin(IEmployeeImpl.java:31)
at cpu.hrms.control.DoLogin.doPost(DoLogin.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)我使用的是Eclipse,也引入了classes12.jar包,尝试过ojdbc14.jar包,可还是不行啊。。。
解决方案
这是驱动没找到啊,看driver路径有没有写错。jar包放在lib下
解决方案二:
贴完整代码出来 不然不知道错误
解决方案三:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
导错了位置吧
时间: 2024-12-22 00:22:21