Field 'OPINION' doesn't have a default value
来源:互联网 发布:jmf605 开卡软件 编辑:程序博客网 时间:2024/05/18 06:27
mysql 和 一段java程序插入一条记录
java程序的话有异常抛出,不能插入.
java.sql.SQLException: Field 'OPINION' doesn't have a default value
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3170)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1316)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1235)
at include.nseer_db.nseer_db_backup1.executeUpdate(nseer_db_backup1.java:97)
at crm.file.register_ok.doPost(register_ok.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at include.anti_repeat_submit.SubmitFilter.doFilter(SubmitFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)
数据库的默认模式已经不是strict mode, 但还是抛出异常了。
As of MySQL 5.0.2, if a column definition includes no explicit DEFAULT value, MySQL determines the default value as follows:
If the column can take NULL as a value, the column is defined with an explicit DEFAULT NULL clause. This is the same as before 5.0.2.
If the column cannot take NULL as the value, MySQL defines the column with no explicit DEFAULT clause. For data entry, if an INSERT or REPLACE statement includes no value for the column, MySQL handles the column according to the SQL mode in effect at the time:
If strict SQL mode is not enabled, MySQL sets the column to the implicit default value for the column data type.
If strict mode is enabled, an error occurs for transactional tables and the statement is rolled back. For non-transactional tables, an error occurs, but if this happens for the second or subsequent row of a multiple-row statement, the preceding rows will have been inserted.
- Field 'OPINION' doesn't have a default value
- Field Doesn't Have a Default Value
- Field 'id' doesn't have a default value
- Field 'id' doesn't have a default value
- Field 'id' doesn't have a default value
- Mysql Field * doesn't have a default value解决方法
- Field 'id' doesn't have a default value问题解决方法
- Field 'id' doesn't have a default value
- Field 'id' doesn't have a default value
- Field 'id' doesn't have a default value
- Mysql Field * doesn't have a default value解决方法hibernate
- hibernate的Field 'id' doesn't have a default value
- Field 'id' doesn't have a default value 原因
- hibernate异常 --- Field "id" doesn't have a default value
- Mysql Field * doesn't have a default value解决方法
- Mysql Field * doesn't have a default value
- Field 'id' doesn't have a default value
- Field 'SeriNo' doesn't have a default value
- 怎样在Windows Mobile上设计一个美观的用户界面程序(Win32)
- 观《南京!南京!》 勿忘国耻 缅怀同胞
- 友元函数
- SQL Server 2000 学习总结(初步)
- My Blog开张
- Field 'OPINION' doesn't have a default value
- 《JavaScript客户端验证和页面特效制作》系列之一
- vmware 找不到eth0解决办法
- 系统程序员成长计划-像机器一样思考(三)
- 感受
- 新版Ycnd 2D 图形引擎SDK 正式发布!
- JS简介及特点/JS与JAVA的区别/JS的运行环境/JS语法及事件简介
- 依旧漂亮的我
- Solaris 10 Advance Administrator 310-202 读书笔记 第四章 ---- Manager Swap Configuration