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

Could not execute JDBC batch update解决方法!
点击下面标题查看本文完整版:Could not execute JDBC batch update解决方法!

org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update 异常:

映射文件:
<hibernate-mapping>
<class name= "personal.hw.Responses " table= "responses " catalog= "bbs ">
<id name= "id " type= "java.lang.Integer ">
<column name= "id " />
<generator class= "increment "/>
</id>
<property name= "title " type= "java.lang.String ">
<column name= "title " length= "20 " not-null= "true " />
</property>
<property name= "content " type= "java.lang.String ">
<column name= "content " length= "500 " />
</property>
<property name= "owner " type= "java.lang.String ">
<column name= "owner " length= "20 " not-null= "true " />
</property>
<property name= "time " type= "java.util.Date ">
<column name= "time " length= "19 " not-null= "true " />
</property>
<property name= "topicId " type= "java.lang.Integer ">
<column name= "topicId " not-null= "true " />
</property>
</class>
</hibernate-mapping>

表结构:
+---------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| title | varchar(20) | NO | | NULL | ? |
| content | varchar(500) | YES | | NULL | ? |
| owner | varchar(20) | NO | | NULL | ? |
| time | datetime | NO | | NULL | ? |