java.sql.SQLException: Field 'ReviewId' doesn't have a default value
来源:互联网 发布:年底做网络推广的好处 编辑:程序博客网 时间:2024/05/16 06:05
2012-05-10 09:01 提问者悬赏:10分 | 汪晨004 | 分类:英语考试 | 浏览1465次
出错啦java.sql.SQLException: Field 'ReviewId' doesn't have a default valueat 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.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1169)at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:693)at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1404)at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1318)at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1303)at dao.ReviewDAO.insert(ReviewDAO.java:33)at servlet.AddReviewServlet.doGet(AddReviewServlet.java:31)at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)at java.lang.Thread.run(Thread.java:619)我会一直在线等哈!
2012-05-10 09:20网友采纳
你的问题我推测有两种情况: 1,如果 ReviewId 为你的一个表的主键,你应该把它设置成自动增长类型 2,如果为非主键你需要把它设置成允许为空或者附默认值具体操作可以查看mysql相关数据的操作:ALTER TABLE 表名 MODIFY ReviewId BIGINT NOT NULL AUTO_INCREMENT PRIMARY
0 0
- java.sql.SQLException: Field 'ReviewId' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value .
- java.sql.SQLException: Field 'IS_STOREDASSUBDIRECTORIES' doesn't have a default value
- Hibernate出现Caused by: java.sql.SQLException: Field 'id' doesn't have a default value原因
- java.sql.SQLException: Field 'Qid' doesn't have a default value
- java.sql.SQLException: Field 'id' doesn't have a default value
- cause by: java.sql,SQLException: Field 'pid' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- java.sql.SQLException: Field 'name' doesn't have a default value
- java.sql.SQLException: General error, message from server: "Field 'ID' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'create_time' doesn't have a default value
- Hibernate中Caused by: java.sql.SQLException: Field 'address_id'doesn't have a default value
- java.sql.SQLException: Field 'id' doesn't have a default value
- java.sql.SQLException: Field 'id' doesn't have a default value解决方案
- Caused by: java.sql.SQLException: Field 'stu_id' doesn't have a default value
- Java实现二叉搜索树
- A - Maximum in Table
- ISAPI简介
- Java:String、StringBuffer和StringBuilder的区别
- scala:java.nio.charset.MalformedInputException
- java.sql.SQLException: Field 'ReviewId' doesn't have a default value
- FTP主动模式和被动模式的比较
- leetcode_142_Linked List Cycle II
- android 调用webService Demo
- AIX系统管理常用命令
- Android学习笔记之fragment
- 通过dmesg分析linux的启动过程,几种放入dmesg文件的方法
- bellman-ford算法(判断是否存在负环)
- 单例模式实现版本1——用局部静态变量