Tomcat老给报这个错误 
  不知道是哪里出个什么问题 请大家帮忙下数据库Mysql
   
   +--------------+-------------+------+-----+---------+-------+
| Field        | Type        | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| id           | int(11)     | NO   | PRI |         |       |
| UserName     | varchar(10) | YES  |     | NULL    |       |
| UserPassword | varchar(10) | YES  |     | NULL    |       |
+--------------+-------------+------+-----+---------+-------+java代码:
  
User.java(部分):public class User implements Serializable {
private int id; private String username; private String password;
UserAccess.java(部分): public void delete(String id) {
String sql = "delete form userinfo where id= "+ id;
Basedao dao = new Basedao();
dao.doInsert(sql);
}UserMgr.java(部分):public void delete(String id)
{
UserAccess ua = new UserAccess();
ua.delete(id);
}UserServlet.java(部分):public class UserServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
req.setCharacterEncoding("gbk");
String type = req.getParameter("type");
res.setCharacterEncoding("gbk");
if (type.equals("login")) {
this.login(req, res);
} else if (type.equals("update")) {
this.update(req, res);
} else if (type.equals("add")) {
this.add(req, res);
} else if (type.equals("delete")) {
this.delete(req, res);
} else if (type.equals("list")) {
this.list(req, res);
} else if (type.equals("view")) {
this.list(req, res);
} } public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException { this.doGet(req, res);
}
public void delete(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
UserMgr mgr = new UserMgr();
String id = req.getParameter("id");
mgr.delete(id);
this.list(req, res); }}jsp页面:
userlist.jsp
  <%@page contentType="text/html;charset=gbk"%>
<%@page errorPage="error.jsp"%>
<%@page import="java.util.*,com.zhangxu.system.model.*"%><style type="text/css">
<!--
body,td,th {
font-family: Courier New, Courier, monospace;
font-size: 14px;
}
body {
background-image: url(img/userlistbg.JPG);
}
-->
</style><CENTER><H1>用户列表</H1></CENTER>
<HR size=5  color="#000000">
<CENTER><a href="UserAdd.jsp">新增用户</a></CENTER><TABLE border=1 align=center>
<TR align=center>
<TD width="161">用户编号</TD>
<TD width="175">用户名称</TD>
<TD width="52">用户密码</TD>
<TD colspan=3>操作</TD>
</TR>
<TR>
<%
List list = (List)request.getAttribute("list");
for(int i=0;i<list.size();i++)
{
User user= (User)list.get(i);%>
<TD><%=user.getId()%></TD>
<TD><%=user.getUsername()%></TD>
<TD>*****</TD>
<TD width="134"><a href="UserServlet?type=view&id=<%=user.getId()%>"><font size="+1" color="#FF0000">查看</font></a></TD>
<TD width="166"><a href="UserServlet?type=delete&id=<%=user.getId()%>"><font size="+1" color="#0000FF">删除</font></a></TD>
<TD width="73"><a href="UserServlet?type=update&id=<%=user.getId()%>"><font size="+1" color="#0000FF">修改</font></a></TD>
</TR>
<%}%>
</TABLE>当点删除的时候  ID传过去 但是数据库老报错  :com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where id= 3' at line 1大家帮我看下 是什么问题啊   
谢谢 了 

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【zhangxu3739】截止到2008-07-14 19:30:33的历史汇总数据(不包括此帖):
    发帖的总数量:3                        发帖的总分数:25                       每贴平均分数:8                        
    回帖的总数量:40                       得分贴总数量:14                       回帖的得分率:35%                      
    结贴的总数量:3                        结贴的总分数:25                       
    无满意结贴数:1                        无满意结贴分:10                       
    未结的帖子数:0                        未结的总分数:0                        
    结贴的百分比:100.00%               结分的百分比:100.00%                  
    无满意结贴率:33.33 %               无满意结分率:40.00 %                  
    敬礼!
      

  2.   

    delete form userinfo where id= "+ id; 错了是from
      

  3.   


    晕 
    这么低级的错误  我一个下午都在找  谢谢了  
    20分给你~~
    Thankyou~~
      

  4.   

    sql语句可能出错了,将sql语句打印出来就知道。