Topic: 帮我看看啊 谢谢了!(需要 "class" 或 "interface")

  Print this page

1.帮我看看啊 谢谢了!(需要 "class" 或 "interface") Copy to clipboard
Posted by: c00lzhang
Posted on: 2005-11-07 17:39

<%@ page contentType="text/html; chatset=gb2312" language="java" import="java.sql.*; java.util.*;" errorPage=""%>
<html>
<head>
<title>ÈËÔ±¹ÜÀí</title>
</head>
<%! String url,sql; %>
<%! Connection conn;%>
<%! ResultSet rs;%>
<%! Statement stmt;%>
<%! int i;%>
<body bgcolor="#ffffff">
<div align="center">
<font color="#000000" size="5">ÈËÔ±¹ÜÀíϵͳ</font>
</div>
<table width="75%" border="1" cellspacing="1" cellpadding="1" align="center">
<tr>
<td width=16% align=center>ID</td>
<td width=16% align=center>Name</td>
<td width=8% align=center>Sex</td>
<td width=8% align=center>Age</td>
<td width=20% align=center>bumen</td>
</tr>
<%
Try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=gongsi";
conn=DriverManager.getConnection(url,"admin","079520");
stmt=conn.createStatement();
sql="select * from gongsi";
rs=stmt.executeQuery(sql);
while(rs.next())
  {
%>
<tr>
<td width=16% align=center><%=rs.getObject(1)%></td>
<td width=16% align=center><%=rs.getObject(2)%></td>
<td width=16% align=center><%=rs.getObject(3)%></td>
<td width=16% align=center><%=rs.getObject(4)%></td>
<td width=16% align=center><%=rs.getObject(5)%></td>
<td width=16% align=center><%=rs.getObject(6)%></td>
<td width=12% align=center><a href="change.jsp?ID=<%=rs.getObject(1)%>">ÐÞ¸Ä</a></td>
<td width=12% align=center><a href="del.jsp?ID=<%=rs.getObject(1)%>">ɾ³ý</a></td>
</tr>
<%
}
rs.close();
stmt.close();
conn.close();
}
catch(Exception e)
{
out.println(e);
}
%>
</table>
<div align="cebter"><a href="insert.jsp">Ìí¼ÓмǼ</a></div>
</body>
<html>

这是代码。
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: Unable to compile class for JSP

Generated servlet error:
E:\tomcat\work\Catalina\localhost\let\org\apache\jsp\list_jsp.java:6: 需要 "class" 或 "interface"
import java.sql.*; java.util.*;;
^

An error occurred at line: 23 in the jsp file: /list.jsp
Generated servlet error:
E:\tomcat\work\Catalina\localhost\let\org\apache\jsp\list_jsp.java:75: 不是语句
Try
^

An error occurred at line: 23 in the jsp file: /list.jsp
Generated servlet error:
E:\tomcat\work\Catalina\localhost\let\org\apache\jsp\list_jsp.java:76: 需要 ';'
{
^
3 错误

  org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
  org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
  org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:437)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
  org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
  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.30 logs.

--------------------------------------------------------------------------------

Apache Tomcat/5.0.30
这是错误提示。

请尽量使用准确的文字描述作为标题
若新帖再無恰当标题,可能会被刪除

Check "Disable Smileys" to avoid funny faces in your code.
Original subject :
帮我看看啊 谢谢了!

>import="java.sql.*; java.util.*;"
Comma (,) SHOULD be used in lieu of semicolon (;), and no ; at the end

>不是语句
>Try
>需要 ';'
>{
Come on! it should be try

Please make a little bit more effort before you post a question!
Don't tell me you have already...

import java.sql.*; java.util.*;;
Try

2.Re:帮我看看啊 谢谢了! [Re: c00lzhang] Copy to clipboard
Posted by: 冷血无情
Posted on: 2005-11-07 18:56

这是JSP文件吧!你应该在JSP区那里发贴了啊


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923