org.apache.jasper.JasperException: Exception in JSP: /Post.jsp:3633: rs.next();
34: int key = rs.getInt(1);
35: rs.close();
36: stmt.executeUpdate("update article set rootid = " + key + "where id =" + key);
37:
38: conn.commit();
39: conn.setAutoCommit(true);
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:489)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause javax.servlet.ServletException: 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 'id =29' at line 1
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.Post_jsp._jspService(Post_jsp.java:125)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause 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 'id =29' at line 1
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1051)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2562)
com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1664)
com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1583)
org.apache.jsp.Post_jsp._jspService(Post_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
34: int key = rs.getInt(1);
35: rs.close();
36: stmt.executeUpdate("update article set rootid = " + key + "where id =" + key);
37:
38: conn.commit();
39: conn.setAutoCommit(true);
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:489)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause javax.servlet.ServletException: 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 'id =29' at line 1
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.Post_jsp._jspService(Post_jsp.java:125)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause 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 'id =29' at line 1
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1051)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2562)
com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1664)
com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1583)
org.apache.jsp.Post_jsp._jspService(Post_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
解决方案 »
- jbpm4改变任务处理人??
- 用struts2实现文件下载功能是报错,java.net.SocketException: Connection reset by peer
- java web
- ResultSetMetaData 的geTableName()获得的一直为空
- 帮忙看下这段代码生成的cookie在哪里?
- 关于setAttribute概念上的问题?
- JSP怎么在客户端允许下载文件?
- 利用超链接遇到的一些问题
- js 函数中如何传递数组参数
- Help me!!!Wait On Line
- filter 过滤出现 getOutputStream() has already been called for this response
- session中可以存字符串吗?如何在页面上获取session中的字符串
34: int key = rs.getInt(1);
35: rs.close();
36: stmt.executeUpdate("update article set rootid = " + key + "where id =" + key);
-------------------
LZ 你到底是最更新还是查询啊 == 还有,如果是查询的话,rs.close()会报错,用try{}tach(){} ,做更新的话你就用不到结果集了吧。
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 'id =29' at line 1
语法错误,建议先在命令行测试这条sql语句。