Data truncation: Data too long for column 'xxx' at row 1

Data truncation: Data too long for column 'xxx' at row 1

完整的错误内容可能是下面这样的:

严重: Servlet.service() for servlet [SpringMVC] in context with path [/zhuozhouzyy] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException

### Error updating database.  Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'content' at row 1

### The error may involve Article.insert-Inline

### The error occurred while setting parameters

### SQL: INSERT INTO `article` (          `id`,          `type`,          `title`,          `content`,          `picture`,          `creat_time`,          `Browase_count`,          `publisher`,          `author`,          `oid`         ) VALUES (          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?         )

### Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'content' at row 1

; SQL []; Data truncation: Data too long for column 'content' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'content' at row 1] with root cause

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'content' at row 1

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3971)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2501)

at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)

at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1197)

at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)

at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)

at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:44)

at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:69)

at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:48)

at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105)

at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:71)

at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152)

at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:141)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)

at com.sun.proxy.$Proxy16.insert(Unknown Source)

at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:240)

at com.wanyu.frame.base.BaseMyIbatisDao.save(BaseMyIbatisDao.java:198)

at com.wanyu.zhuozhouzyy.dao.ArticleDao.saveOrUpdate(ArticleDao.java:31)

at com.wanyu.zhuozhouzyy.dao.ArticleDao.saveOrUpdate(ArticleDao.java:20)

at com.wanyu.frame.base.BaseManager.saveOrUpdate(BaseManager.java:68)

at com.wanyu.zhuozhouzyy.controller.ArticleController.save(ArticleController.java:141)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)

at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at com.wanyu.frame.base.AuthFilter.doFilter(AuthFilter.java:77)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1524)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1480)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)


其实产生这个错误的原因就是 'xxx' 字段设置的长度太小了,或者说你给这个字段赋值的内容太长了。

如果确实不希望那么长,就做字符串截取;

如果想都放进去,就把字段的长度或类型改一下;

比如 Varchar 的长度是很有限的,那你就可以用 Text、mediumtext,longtext;

或者你也可以用 blob,mediumblob,longblob;


已标记关键词 清除标记
<p><span style="font-size: 24px; background-color: #e53333; color: #ffffff;"><strong>课程目标</strong></span></p> <p> </p> <p><span style="font-size: 18px;">从零开始掌握Premiere影视剪辑的基础知识,学会</span><span style="font-size: 18px; color: #e53333;"><span style="color: #e53333;"><strong>视频剪辑+影视特效+视频调色+字幕制作</strong></span></span></p> <p> </p> <p><span style="font-size: 24px; background-color: #e53333; color: #ffffff;">适用人群</span></p> <p> </p> <p><span style="font-size: 18px;">PR零基础小白,在校大学生,职场新人,想成为影视剪辑、影视后期、短视频制作、自媒体等高手的朋友。</span></p> <p> </p> <p><span style="font-size: 24px; background-color: #e53333; color: #ffffff;">课程简介</span></p> <p> </p> <p><span style="font-size: 18px;">课程以新版PR 2020讲解,可使用PR任意版本学习,绝大多数功能兼容旧版,但强烈建议使用新版本。</span></p> <p><span style="font-size: 18px;">【Adobe认证专家讲师精耕细作精品教程,非学院派照本宣科软件操作教程,以任务为导向,面向实际应用场景,每一章都能学会实打实的高手技能,讲解细致,小白也能轻松入门成大神!】</span></p> <p><span style="font-size: 18px;">课程好不好,看过就知道,前面的免费章节欢迎试看。</span></p> <p><span style="font-size: 18px;">本课程学习不需要任何PR基础,只需要电脑操作基础即可。兼容Windows和Mac操作系统,同时讲解两种系统下的快捷键操作,不用担心操作上的障碍问题。</span></p> <p> </p> <p><span style="font-size: 24px; background-color: #e53333; color: #ffffff;">课程特色</span></p> <p> </p> <p><span style="font-size: 18px;">1、以实际PR影视编辑与特效的流程为导向,绝大多数内容都是为了完成某个具体任务,而不是为了讲解某个软件操作而凑数。</span></p> <p><span style="font-size: 18px;">2、不同于国内多数教程和书籍,每个知识点务求讲精、讲透,帮助你掌握PR的精髓,而非软件操作上的皮毛,让你真正学到PR的本质,一次学习,终身受用,少走弯路,节约生命。</span></p> <p><span style="font-size: 18px;">3、课程会随PR新版本的推出持续更新,不必担心有新功能却不知道怎么用。</span></p> <p><span style="font-size: 18px;">4、充足的练习题和作业题,让你在不断的练习和挑战中提升PR技能。</span></p> <div> <p> </p> <p><img src="https://img-bss.csdnimg.cn/202009230003497469.png" alt="" width="880" height="2635" /><img src="https://img-bss.csdnimg.cn/202009230004006917.png" alt="" width="880" height="2635" /><img src="https://img-bss.csdnimg.cn/202009230004102289.png" alt="" width="880" height="2635" /><img src="https://img-bss.csdnimg.cn/202009230004197845.png" alt="" width="880" height="1445" /></p> </div>
相关推荐
<span> </span> <div> 以通俗简介的方式,从浅入深介绍SVM原理和代码流程 让你从此不再惧怕SVM <br /> </div> <div> <p> <br /> </p> <p> <br /> </p> <p> <strong><span style="color:#E53333;">视频部分:</span></strong> </p> </div> 01_SVM之回顾梯度下降原理<br /> 02_SVM之回顾有约束的最优化问题<br /> 03_SVM之回顾有约束的最优化问题-KKT几何解释<br /> 04_SVM之回顾有约束的最优化问题-KKT数学解释<br /> 05_SVM之回顾距离公式和感知器模型<br /> 06_SVM之感知器到SVM的引入<br /> 07_SVM之线性可分时损失函数的表示<br /> 08_SVM之线性可分时损失函数的求解-对w,b变量求偏导<br /> 09_SVM之线性可分时损失函数的求解-对β变量求解.<br /> 10_SVM之线性可分时算法整体流程<br /> 11_SVM之线性可分时案例<br /> 12_SVM之线性不可分时软间隔介绍<br /> 13_SVM之线性不可分时软间隔优化目标<br /> 14_SVM之线性不可分时软间隔算法整体流程<br /> 15_SVM之线性不可分时数据映射高维解决不可分问题<br /> 16_SVM之线性不可分时核函数引入<br /> 17_SVM之线性不可分时核函数讲解<br /> 18_SVM代码之线性可分时和Logistic回归比较<br /> 19_SVM代码之基于鸢尾花数据多分类参数解释<br /> 20_SVM代码之基于鸢尾花数据网格搜索选择参数<br /> 21_SVM代码之不同分类器,核函数,C值的可视化比较<br /> <p> 22_SVM之回归方式SVR </p> <p> 23_SVM代码之SVR解决回归问题 </p> 24_SVM之SMO思想引入<br /> <p> 25_SVM之SMO案列讲解 </p> <p> <br /> </p> <p> <strong><span style="color:#E53333;">代码部分:</span></strong> </p> <p> <img src="https://img-bss.csdn.net/202005090648425294.png" alt="" /> </p> <p> <br /> </p> <p> <strong><span style="color:#E53333;">资料部分:</span></strong> </p> <p> <img src="https://img-bss.csdn.net/202005090649458459.png" alt="" /> </p>
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页