数据库链接到应用程序时出错

2izufjch  于 2021-06-23  发布在  Mysql
关注(0)|答案(1)|浏览(357)

我一直在尝试运行我的项目,这是一个网络应用程序,以excel表作为输入和处理数据。直到最近执行是顺利进行,但只有今天上午,我得到以下错误,做帮助
PooligDao中出现异常==>insertclass():

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'item_codes' at row 1
at com.mysql.jdbc.PreparedStatement.executeInternal 
at com.mysql.jdbc.PreparedStatement.executeUpdate
at com.mysql.jdbc.PreparedStatement.executeUpdate   
at com.Fidoop.DAOFactory.PoolingDAO.insert_to_mbill(PoolingDAO.java:471)
at com.Fidoop.util.GetInvoiceRead.Itemlistread(GetInvoiceRead.java:63)
at com.action.user.UploadFileMaster.doPost(UploadFileMaster.java:291)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
at org.apache.catalina.core.ApplicationFilterChain.doFilter
at org.apache.catalina.core.StandardWrapperValve.invoke
at org.apache.catalina.core.StandardContextValve.invoke
at org.apache.catalina.authenticator.AuthenticatorBase.invoke
at org.apache.catalina.core.StandardHostValve.invoke
at org.apache.catalina.valves.ErrorReportValve.invoke
at org.apache.catalina.valves.AccessLogValve.invoke
at org.apache.catalina.core.StandardEngineValve.invoke
at org.apache.catalina.connector.CoyoteAdapter.service
at org.apache.coyote.http11.AbstractHttp11Processor.process
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
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:2542)
at java.lang.Thread.run(Unknown Source)

已创建新连接向量:[com.mysql.jdbc。jdbc4connection@75c5a4]销毁连接删除重复字:

vmpqdwk3

vmpqdwk31#

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'item_codes' at row 1 这个错误来自mysql,因为您试图持久化的内容对于给定字段来说太大了 item_codes . 你有几种选择来缓解这种情况
表上的字段长度*
调整电子表格中的字符长度
按程序修剪输入的长度。

相关问题