HTTP Status 500 - javax.servlet.ServletException: java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
type Exception report
message javax.servlet.ServletException: java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:556) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:462) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
《----------------------------------------------------》
十二月 15, 2015 10:39:32 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [jsp] in context with path [/hhl] threw exception [javax.servlet.ServletException: java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver] with root cause
java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1856)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:126)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
没有jdbcodbcdriver。记得导个包
怎么导入呢?
@李帅520: 这个包在jdk6里面自带,你用的jdk几?8?
@之奇一昂: 以前用的是8现在又下载了7可是就是连接不上数据库啊,我用的是笔记本电脑
@李帅520: 你还是把更详细的出错信息贴出来吧
提示这么清楚不看
sun.jdbc.odbc.JdbcOdbcDriver这个类所在的包导入
具体怎么弄?
sun.jdbc.odbc.JdbcOdbcDriver 可以尝试从网上下载,并拷贝到项目的Lib下(或者配置classpath路径)
1、查一下sun.jdbc.odbc.JdbcOdbcDriver在那个jar包里
2、下载jar包
3、jar放到web-inf/lib目录下
在jdk/jre/lib/rt.jar中