tomcat 提示如下:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: student/conn
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:244)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: student/conn
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
java.lang.Class.getConstructor0(Class.java:2640)
java.lang.Class.newInstance0(Class.java:321)
java.lang.Class.newInstance(Class.java:303)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
数据库都好者.用户名与密码都对者呢.....
球球,那两句代码是那错了? 我都弄好两天了,还没连上....快帮帮我吧..
这是原文件,大家看一下.
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.sql.*" %>
<%@ page import="javax.sql.*" %>
<html>
<body>
<%
String sDBDriver="com.mysql.jdbc.Driver";
String sConnStr="jdbc:mysql://localhost:3306/chen";
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
try{
Class.forName(sDBDriver);
con=DriverManager.getConnection(sConnStr,"root","chenxfu");
stmt=con.createStatement();
rs=stmt.executeQuery("select * from book");
while(rs.next()){
out.println(""+rs.getString(1)+"");
out.println(":"+"<br>");
out.println(rs.getString(2));
out.println(rs.getString(3));
}
rs.close();
}
catch(Exception e){
out.println(e);
}
%>
</body>
</html>