mysql-JSP页面无法进行发布操作
提示信息:
java.sql.SQLException: Column count doesn't match value count at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2548)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1605)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1524)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
at com.wy.JDBConnection.executeUpdata(JDBConnection.java:39)
at org.apache.jsp.good_005fconfig_jsp._jspService(good_005fconfig_jsp.java:120)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
有关代码:
Good_config page
Date date=new Date();
String sql;
ResultSet rs;
%>
request.setCharacterEncoding("gb2312");
String gname=request.getParameter("gname");
String gclass=request.getParameter("gclass");
String gcount=request.getParameter("gcount");
String gunit=request.getParameter("gunit");
String startProvince=request.getParameter("startProvince");
String gstartcity=request.getParameter("gstartcity");
String endProvince=request.getParameter("endProvince");
String gendcity=request.getParameter("gendcity");
String gtransstyle=request.getParameter("gtransstyle");
String gtime=request.getParameter("gtime");
String glink=request.getParameter("glink");
String gphone=request.getParameter("gphone");
String gremark=request.getParameter("gremark");
String grequest=request.getParameter("grequest");
String username=(String)session.getAttribute("name");
java.sql.Date gshowdate=new java.sql.Date(date.getYear(),date.getMonth(),date.getDate());
sql="insert into tb_GoodsMeg values('"+gclass+"','"+
gname+"','"+gcount+"','"+gunit+"','"+startProvince+"','"+
gstartcity+"','"+endProvince+"','"+gendcity+"','"+
gtransstyle+"','"+gtime+"','"+gphone+"','"+
glink+"','"+gshowdate+"','"+gremark+"','"+grequest+"','"+username+"')";
boolean sert=connection.executeUpdata(sql);
if(sert)
{%>
response.sendRedirect("goods_select.jsp");
}else
{
%>
response.sendRedirect("goods_add.jsp");
}
%>
上一篇: php上传文件常见问题(基础)
下一篇: ajax实现无刷新分页
推荐阅读
-
Asp.net页面中调用soapheader进行验证的操作步骤
-
Asp.net页面中调用soapheader进行验证的操作步骤
-
sql server 还原数据库时提示数据库正在使用,无法进行操作的解决方法
-
JSP页面IE无法打开Internet 站点…… 已终止操作 的解决方法
-
sql server 还原数据库时提示数据库正在使用,无法进行操作的解决方法
-
ASP.net在页面所有内容生成后、输出内容前对页面内容进行操作
-
JSP页面IE无法打开Internet 站点…… 已终止操作 的解决方法
-
iOS开发中如何进行真机调试?ios应用发布操作步骤解析!
-
解决vue-router进行build无法正常显示路由页面的问题
-
nginx禁止直接通过ip进行访问并跳转到自定义500页面的操作