首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

急求达人帮助!Hibernate插入的有关问题

2011-12-11 
急求达人帮助!Hibernate插入的问题org.hibernate.exception.GenericJDBCException:couldnotinsert:[struct

急求达人帮助!Hibernate插入的问题
org.hibernate.exception.GenericJDBCException:   could   not   insert:   [struction.dao.Dispr00f]
at   org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at   org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at   org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at   org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2078)
at   org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2427)
at   org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
at   org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at   org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at   org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at   org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at   org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at   org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at   org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at   org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at   struction.service.DoMainPlanService.insert_rec(DoMainPlanService.java:114)
at   struction.service.Test.main(Test.java:32)
Caused   by:   java.sql.DataTruncation:   Data   truncation
at   com.ibm.as400.access.AS400JDBCPreparedStatement.testDataTruncation(AS400JDBCPreparedStatement.java:2857)
at   com.ibm.as400.access.AS400JDBCPreparedStatement.setValue(AS400JDBCPreparedStatement.java:2805)
at   com.ibm.as400.access.AS400JDBCPreparedStatement.setString(AS400JDBCPreparedStatement.java:2478)
at   org.hibernate.type.StringType.set(StringType.java:26)
at   org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83)
at   org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)
at   org.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:238)
at   org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1837)
at   org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1803)
at   org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2059)
...   12   more

[解决办法]
show_sql设为true把sql打出来看看啊
[解决办法]
在哪把show_sql设为true?

热点排行