读书人

hibernate 二

发布时间: 2012-10-09 10:21:45 作者: rapoo

hibernate 2
hibernate 3.5.3
插入数据
Hibernate: insert into users (username, password, is_used, real_name, sex, tell_phone, cell_phone, email, region, city, zip, address, company, title, price, news_letter, create_date, user_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update

原因:对象对应的表的某个(些)字段的长度不够
具体:tellphone字段为varchar(10) debug时发现是char(12)

读书人网 >软件架构设计

热点推荐