Hibernate operation: Could not execute JDBC batch update

  • Post author:
  • Post category:其他





Hibernate operation: Could not execute JDBC batch update;


错误解决


在使用验证框架的时候,若不验证,则无此错误,若首先让字段为空,即经过了验证,则会报如上错误。


我采用的是


ORACLE


数据库,在


hibernate


反向生成


.hbm.xml


文件时,如下所示;




<?xml version=”1.0″ encoding=”utf-8″?>

<!DOCTYPE hibernate-mapping PUBLIC “-//Hibernate/Hibernate Mapping DTD 3.0//EN”





http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd



“>

<!–

Mapping file autogenerated by MyEclipse Persistence Tools

–>

<hibernate-mapping>

<class name=”com.ISSC.customer.Customer” table=”CUSTOMER”

schema=”XIAYANHUA”>


<id name=”cusid” type=”string”>

<column name=”CUSID” length=”5″ />

<generator class=”assigned”></generator>

</id>

<property name=”cusname” type=”string”>

<column name=”CUSNAME” length=”20″ />

</property>

</class>

</hibernate-mapping>




其中


schema


后的值为用户,而并非数据库的名称,将其去掉既可