日期:2014-05-16  浏览次数:20956 次

求助:数据库连接成功,在执行update时出现错误:com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'id' at row 1
求助:数据库连接成功,在执行update时出现错误:com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'id' at row 1
错误代码如下:

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'id' at row 1
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3489)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
  at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
  at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
  at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)
  at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1564)
  at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1485)
  at DBConnector.Connector.executeUpdate(Connector.java:45)
  at org.apache.jsp.TestSQL_jsp._jspService(TestSQL_jsp.java:78)
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
  at java.lang.Thread.run(Thread.java:619)
hey,I've got it.I got the DBLink.
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'id' at row 1
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3489)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
  at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
  at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
  at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)
  at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1564)
  at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1485)
  at DBConnector.Connector.executeUpdate(Connector.java:45)
&nb