st.executeUpdate("REPLACE insertlist SET Id="+Id+",Title="+Title+",StartElement="+StartElement+",EndElement="+EndElement+",Content="+Content+",FileList="+FileList+" WHERE Id="+Id+"");在sql语句中,字符型的数据要用单引号括起来。写成这样:
st.executeUpdate("REPLACE insertlist SET Id='"+Id+"',Title='"+Title+"',StartElement='"+StartElement+"',EndElement='"+EndElement+"',Content='"+Content+"',FileList='"+FileList+"' WHERE Id="+Id+"");

解决方案 »

  1.   

    好象是sql语句里的字符串包含有中文字符,成了乱码。
    对那几个request.getParameter();中可能包含中文的字符串转换下编码试试。
      

  2.   

    st.executeUpdate("REPLACE insertlist SET Id='"+Id+"',Title='"+Title+"',StartElement='"+StartElement+"',EndElement='"+EndElement+"',Content='"+Content+"',FileList='"+FileList+"' WHERE Id='"+Id+"'");
      

  3.   

    SQL语法错误,先把SQL语句打印出来检查一下。。看有没有漏符号,还要注意数据类型的差别
      

  4.   

    request.getParameter()里面没有中文
    我加了单括号
    新的错误是org.apache.jasper.JasperException: Syntax error or access violation: 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=1' at line 1还是没有写入数据库啊
      

  5.   

    是单括号没有匹配好,这样就行了:
    st.executeUpdate("REPLACE insertlist SET Id='"+Id+"',Title='"+Title+"',StartElement='"+StartElement+"',EndElement='"+EndElement+"',Content='"+Content+"',FileList='"+FileList+"' WHERE Id='"+Id+"'");