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后的值为用户,而并非数据库的名称,将其去掉既可