JSP连接数据库问题,请帮帮我!
JSP连接数据库问题,请帮帮我!1.JDK装好了,C:\Program Files\Java\jdk1.6.0_10\bin
2.Tomcat装好了,C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin
3.环境变量配好了,classpath:C:\Program Files\Java\jdk1.6.0_10\lib\mysql-connector-java-5.1.7-bin.jar;C:\Program Files\Java\jdk1.6.0_10\lib\tools.jar;D:\mysql-connector-java-5.1.7\mysql-connector-java-5.1.7-bin.jar
path:C:\Program Files\StormII;C:\Program Files\Java\jdk1.6.0_10\bin;
4.mysql装好了,MySQL Server 5.1
5.mysql-connector-java-5.1.7-bin.jar放在D盘下,并且我在C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\DB\WEB-INF也放了。
6.JSP代码也写好了放在C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\DB\Db.jsp
可是运行时,就是通不过,我把浏览器的错误代码附上,请帮帮我,我怎么做才能连上数据库,谢谢您!!!
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:600)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.Db_jsp
(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
(Unknown Source)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.