public boolean huifu(Liuyan liuyan,int id)
{
boolean flag=false;

try
{
con=db.getConnection();
String sql="insert into liuyan (restore) values (?) where id=?";
pstmt=con.prepareStatement(sql);
pstmt.setString(1, liuyan.getRestore());
pstmt.setInt(2,id);

            int i=pstmt.executeUpdate();
if(i>0)
{
flag=true;
}
else
{
flag=false;
}
}catch(Exception e)
{
e.printStackTrace();
}

return flag;

}

}那个SQL语句有没有错误???调试 就那个地方错的 <form action="HuifuServlet?mothod=huifu" method="post">
    
     <textarea rows="45" cols="60" name="restore" style="width: 729px; height: 79px"></textarea>
     <input type="submit" value="回复">
   </form> //回复
public void  huifu(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
    response.setCharacterEncoding("GBK");
    response.setContentType("text/html;charset=gb2312");
    PrintWriter out=response.getWriter();
HttpSession session=request.getSession();

    int id=(Integer)session.getAttribute("id1");
  System.out.println(id);
    
    String  restore=request.getParameter("restore");
    restore=new String(restore.getBytes("ISO-8859-1"),"gb2312");
     
   Liuyan liuyan=new Liuyan();
   liuyan.setId(id);
   liuyan.setRestore(restore); LiuyanDao ld=new LiuyanDao();
boolean flag=ld.huifu(liuyan, id);

if (flag==true)
{
out.print("<script>alert('恭喜您,回复成功!');window.location.href='blog/restore.jsp';</script>");
}
else
{
out.print("<script>alert('对不起,回复失败!');window.location.href='blog/huifu.jsp';</script>");
}

}
/**