hibernate :Could not execute JDBC batch update我要崩溃了求大神光芒!!! 10
Hibernate:insertintoStudent(name,age,id)values(?,?,?)Exceptioninthread"main"org.hiber...
Hibernate: insert into Student (name, age, id) values (?, ?, ?)
Exception in thread "main" org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at StudentTest.main(StudentTest.java:23) 展开
Exception in thread "main" org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at StudentTest.main(StudentTest.java:23) 展开
6个回答
展开全部
批处理的数量过大,或者你插入的类型与对象中的不对应
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
jdbc 的插入写法应该 是表名而不是类名
insert into 表名 (name, age, id) values (?, ?, ?)
insert into 表名 (name, age, id) values (?, ?, ?)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在数据库里,把id设置成自动增长的,insert里面只添加name和age。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个说明你的sql语句有问题!请检查?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-09-13
展开全部
数据类型不匹配
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询