Hibernate operation: could not insert: 急问 [问题点数:20分,结帖人lvkai0452]

Bbs4
本版专家分:1094
结帖率 98.89%
Bbs5
本版专家分:2962
Bbs6
本版专家分:6198
Bbs4
本版专家分:1094
Bbs6
本版专家分:6198
Bbs6
本版专家分:6198
Bbs6
本版专家分:6198
Bbs7
本版专家分:13202
Blank
蓝花 2008年5月 Java大版内专家分月排行榜第三
Bbs1
本版专家分:65
Bbs2
本版专家分:267
Bbs1
本版专家分:0
hibernate的简单应用,出现could not insert错误,到底连上数据库没?
tomcat的控制台出现:Hibernate: <em>insert</em> into grade (name) values (?) select scope_identity() 跳出的异常如下: net.sf.
hibernate发生GenericJDBCException: could not insert collection
程序大概如下 FileItem fileItem = (FileItem) fileItr.next(); // System.out.println(item.getString()); if (!
JPA中could not insert: 的解决办法
报错如下: javax.persistence.PersistenceException: org.<em>hibernate</em>.exception.GenericJDBCException: <em>could</em> not <em>insert</em>: [com.zj.bean.Person] persistence.xml: <persistence
hibernate报错could not insert
javax.persistence.PersistenceException: org.<em>hibernate</em>.exception.SQLGrammarException: <em>could</em> not <em>insert</em>: [com.ebs.core.source.model.SourceNCPItem] 项目以前保存功能是正常的,后来我新增了一个字段 /** * 说明(对应报告中备注) */...
hibernate 插入数据时报 could not insert 高手进
我在操作一个含有外键的表时插入数据竟然抛出如下错误,望高手指教!不甚感激 org.springframework.dao.DataIntegrityViolationException: <em>could</em>
Struts2.0+Hibernate3.0+Spring2.0 出现了Hibernate的could not insert 异常!!
org.<em>hibernate</em>.exception.SQLGrammarException: <em>could</em> not <em>insert</em>: [bbs.ggitc.<em>hibernate</em>.bean.MiniBlog]rn at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:67)rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2078)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2427)rn at org.<em>hibernate</em>.action.EntityInsertAction.execute(EntityInsertAction.java:51)rn at org.<em>hibernate</em>.engine.ActionQueue.execute(ActionQueue.java:248)rn at org.<em>hibernate</em>.engine.ActionQueue.executeActions(ActionQueue.java:232)rn at org.<em>hibernate</em>.engine.ActionQueue.executeActions(ActionQueue.java:139)rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)rn at org.<em>hibernate</em>.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)rn at org.<em>hibernate</em>.impl.SessionImpl.flush(SessionImpl.java:985)rn at org.<em>hibernate</em>.impl.SessionImpl.managedFlush(SessionImpl.java:333)rn at org.<em>hibernate</em>.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:578)rn at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)rn at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy26.saveMimiBlog(Unknown Source)rn at com.ggitc.bbs.struts.action.MiniBlogAction.saveminiblog(MiniBlogAction.java:38)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn (ServletConfigInterceptor.java:170)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.orm.<em>hibernate</em>3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.ggitc.util.EncodingFilter.doFilter(EncodingFilter.java:64)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)rn at java.lang.Thread.run(Unknown Source)rnCaused by: com.microsoft.sqlserver.jdbc.SQLServerException: 当 IDENTITY_INSERT 设置为 OFF 时,不能为表 'mini_blog' 中的标识列插入显式值。rn at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)rn at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)rn at com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown Source)rn at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteUpdate(Unknown Source)rn at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(Unknown Source)rn at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)rn at org.<em>hibernate</em>.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2062)rn ... 148 morern
mysql数据库insert急问!!!
如下语句,运行出来的结果为何第一次插入记录成功,第二次插入却失败???rn谢谢大侠了!!!急呀!!!!!rnrn$db = mysql_connect("localhost", "aaa","bbb");rnmysql_select_db("aaa",$db);rnif(mysql_query("<em>insert</em> into baosun values('1','aa','bb',now())",$db))rnrn echo "成功!!! :)";rnrnelsernrn echo "失败!!! :( ";rnrnif(mysql_query("<em>insert</em> into baosun values('2','cc','dd',now())",$db))rnrn echo "成功!!! :)";rnrnelsernrn echo "失败!!! :( ";rn
vs2010 启动错误 the operation could not be...
昨天系统自动升级后,导致vs2010无法正常启动,提示上述错误,卸载.net 4也没用,vs2010是英文旗舰版 RC,这个问题如何解决?谢谢
could not insert: [report.model.tableName]
[code=Java]rnHibernate: <em>insert</em> into UserInf (Name, Unit_name, Pass, useNum, userRole, userLimit, click, userDate) values (?, ?, ?, ?, ?, ?, ?, ?) select scope_identity()rnException in thread "main" org.<em>hibernate</em>.exception.SQLGrammarException: <em>could</em> not <em>insert</em>: [report.model.UserInf]rn at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:67)rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.<em>hibernate</em>.id.<em>insert</em>.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2108)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2588)rn at org.<em>hibernate</em>.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)rn at org.<em>hibernate</em>.engine.ActionQueue.execute(ActionQueue.java:248)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)rn at org.<em>hibernate</em>.impl.SessionImpl.fireSave(SessionImpl.java:535)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:523)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:519)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.<em>hibernate</em>.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)rn at $Proxy0.save(Unknown Source)rn at test.test0.main(test0.java:37)rnCaused by: java.sql.SQLException: [Microsoft][SQLServer JDBC Driver][SQLServer]对象名 'UserInf' 无效。rn at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)rn at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)rn at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)rn at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)rn at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)rn at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)rn at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:911)rn at org.<em>hibernate</em>.id.IdentityGenerator$InsertSelectDelegate.executeAndExtract(IdentityGenerator.java:108)rn at org.<em>hibernate</em>.id.<em>insert</em>.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)rn ... 22 morern[/code]昨天好好的,今天把数据库重新创建一下就不行了,不知道哪位大哥可以帮看看!!
org.hibernate.exception.GenericJDBCException: could not insert: [org.cn.com.wceb
log4j:WARN No appenders <em>could</em> be found for logger (org.<em>hibernate</em>.cfg.Environment).rnlog4j:WARN Please initialize the log4j system properly.rnHibernate: rn <em>insert</em> rn intorn customerrn (name) rn valuesrn (?)rnHibernate: rn <em>insert</em> rn intorn rn order (orderNumberrn , customer_id) rnvaluesrn (?, ?)rnException in thread "main" org.<em>hibernate</em>.exception.GenericJDBCException: <em>could</em> not <em>insert</em>: [org.cn.com.wceb.entity.Order]rn at org.<em>hibernate</em>.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)rn at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:114)rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)rn at org.<em>hibernate</em>.id.<em>insert</em>.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2176)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2656)rn at org.<em>hibernate</em>.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)rn at org.<em>hibernate</em>.engine.ActionQueue.execute(ActionQueue.java:279)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)rn at org.<em>hibernate</em>.impl.SessionImpl.fireSave(SessionImpl.java:563)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:551)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:547)rn at org.cn.com.wceb.test.TestService.saveCustomerAndOrder(TestService.java:25)rn at org.cn.com.wceb.test.TestService.main(TestService.java:31)rnCaused by: java.sql.SQLException: 在关键字 'order' 附近有语法错误。rn at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)rn at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)rn at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)rn at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)rn at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)rn at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)rn at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:504)rn at org.<em>hibernate</em>.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)rn at org.<em>hibernate</em>.id.<em>insert</em>.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)rn ... 17 more
xcode报错Could not insert....
xcode报错: Could not <em>insert</em> new outlet connection:Could not find a class named ViewController in the language Swift 最简单的办法: 将Controller的文件名更改 亲测管用 将‘ViewController’ 的文件名和类型随便改一个,然后重新关联.storyb...
GenericJDBCException:couldnot insert: [com.hibernate.Customer]异常
GenericJDBCException:<em>could</em>not <em>insert</em>: [com.<em>hibernate</em>.Customer]异常解决方法:1.如果你的<em>hibernate</em>.cfg.xml的URL后面写了characterEncoding=utf8,把这个去掉&amp;lt;!--连接数据库的url --&amp;gt;    &amp;lt;property name=&quot;<em>hibernate</em>.connection.url&quot;&amp;...
“org.hibernate.exception.SQLGrammarException: could not insert...”解决方法
HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.springframework.dao.InvalidDa
insmod: ERROR: could not insert module xxx.ko: Operation not permitted
今天编程插入模块的时候遇到了这个问题,具体报错信息如下: insmod: ERROR: <em>could</em> not <em>insert</em> module analyze_inode.ko: Operation not permitted 看到 Operation not permitted首先想到的就是权限问题,但是我已经在超级权限下执行了这个命令,情况如下图所示: 可是在root用户或者sudo权限下...
org.hibernate.exception.GenericJDBCException: could not insert:
错误信息: 15:34:09,937 INFO org.<em>hibernate</em>.tool.hbm2ddl.SchemaUpdate:155 - Running hbm2ddl schema update
求助:org.hibernate.exception.SQLGrammarException: could not insert:
Struts2+Spring3+Hibernate3 整合rn数据库:SQL Server2005 服务器:apache-tomcat-8.0.0-RC1 开发环境:Myeclipse8.5 rn报错异常如下:rnStruts Problem ReportrnStruts has detected an unhandled exception: rnMessages: '107' ???????? rn<em>could</em> not <em>insert</em>: [com.gxwz.entity.GxUser] rn<em>could</em> not <em>insert</em>: [com.gxwz.entity.GxUser]; SQL [<em>insert</em> into 107gxwz.dbo.gx_user (UName, UPwd, UGender, UEmal, URole, UHead, URegDate, ULastLogin, ULastEmit, UPermit, UMobile, UUploadFilesIDs, UDownLoadFileIDs, UUrl, UTopicIDs, URevertIDs) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is org.<em>hibernate</em>.exception.SQLGrammarException: <em>could</em> not <em>insert</em>: [com.gxwz.entity.GxUser] rnFile: com/microsoft/sqlserver/jdbc/SQLServerException.java rnLine number: 216 rn--------------------------------------------------------------------------------rnrnStacktracesrnorg.springframework.dao.InvalidDataAccessResourceUsageException: <em>could</em> not <em>insert</em>: [com.gxwz.entity.GxUser]; SQL [<em>insert</em> into 107gxwz.dbo.gx_user (UName, UPwd, UGender, UEmal, URole, UHead, URegDate, ULastLogin, ULastEmit, UPermit, UMobile, UUploadFilesIDs, UDownLoadFileIDs, UUrl, UTopicIDs, URevertIDs) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is org.<em>hibernate</em>.exception.SQLGrammarException: <em>could</em> not <em>insert</em>: [com.gxwz.entity.GxUser] rn org.springframework.orm.<em>hibernate</em>3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:629)rn org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)rn org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.doExecute(HibernateTemplate.java:411)rn org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)rn org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.save(HibernateTemplate.java:683)rn com.gxwz.dao.impl.UserDaoImpl.add(UserDaoImpl.java:30)rn com.gxwz.service.impl.UserServiceImpl.add(UserServiceImpl.java:35)rn com.gxwz.action.UserAction.addUser(UserAction.java:47)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:606)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:223)rn org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:107)rn org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)rn org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:75)rn org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:934)rn org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:90)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:494)rn org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)rn org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:632)rn org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:281)rn org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2248)rn org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2237)rn java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn java.lang.Thread.run(Thread.java:724)rnrn
org.hibernate.exception.GenericJDBCException: could not insert: [db.Ch02]
Hibernate初学者,测试一下mysql数据库操作,这问题解决不了,求助啊,谢谢:rntest.java:rnpackage db;rnrnimport org.<em>hibernate</em>.*;rnimport org.<em>hibernate</em>.cfg.*;rnrnpublic class test rnrn rn /**rn * @param argsrn */rn public static void main(String[] args) rn tryrn SessionFactory sf = new Configuration().configure().buildSessionFactory();rn Session session = sf.openSession();rn Transaction tx = session.beginTransaction();rn Ch02 user = new Ch02(1);rn System.out.println(user.getId());rn //user.setUserName("fmy");rn //user.setPassword("123");rn session.save(user);rn tx.commit();rn session.close();rn catch (HibernateException e)rn e.printStackTrace();rn rn rnrnrnrnCh02.java:rnpackage db;rnrn/**rn * Ch02 entity. @author MyEclipse Persistence Toolsrn */rnrnpublic class Ch02 implements java.io.Serializable rnrn // Fieldsrnrn private int id;rn private String userName;rn private String password;rn private String email;rnrn // Constructorsrnrn /** default constructor */rn public Ch02() rn rnrn /** minimal constructor */rn public Ch02(int id) rn this.id = id;rn rnrn /** full constructor */rn public Ch02(int id, String userName, String password, String email) rn this.id = id;rn this.userName = userName;rn this.password = password;rn this.email = email;rn rnrn // Property accessorsrnrn public int getId() rn return this.id;rn rnrn public void setId(int id) rn this.id = id;rn rnrn public String getUserName() rn return this.userName;rn rnrn public void setUserName(String userName) rn this.userName = userName;rn rnrn public String getPassword() rn return this.password;rn rnrn public void setPassword(String password) rn this.password = password;rn rnrn public String getEmail() rn return this.email;rn rnrn public void setEmail(String email) rn this.email = email;rn rnrnrnrnCh02.hbm.xml:rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn<em>hibernate</em>.cfg.xml:rnrnrnrnrnrnrnrn truern ch02rn rn jdbc:mysql://localhost:3306/testrn rn rootrn mysqlrn rn com.mysql.jdbc.Driverrn rn rn org.<em>hibernate</em>.dialect.MySQLDialectrn rn rnrnrnrnrnrn异常信息:rnHibernate: <em>insert</em> into ch02.ch02 (UserName, Password, Email) values (?, ?, ?)rnorg.<em>hibernate</em>.exception.GenericJDBCException: <em>could</em> not <em>insert</em>: [db.Ch02]rn at org.<em>hibernate</em>.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)rn at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:114)rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)rn at org.<em>hibernate</em>.id.<em>insert</em>.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2176)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2656)rn at org.<em>hibernate</em>.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)rn at org.<em>hibernate</em>.engine.ActionQueue.execute(ActionQueue.java:279)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)rn at org.<em>hibernate</em>.impl.SessionImpl.fireSave(SessionImpl.java:563)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:551)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:547)rn at db.test.main(test.java:22)rnCaused by: java.sql.SQLException: Field 'ID' doesn't have a default valuern at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)rn at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)rn at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)rn at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)rn at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)rn at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2427)rn at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2345)rn at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2330)rn at org.<em>hibernate</em>.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)rn at org.<em>hibernate</em>.id.<em>insert</em>.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)rn ... 16 morernrn求大神,多谢啊
org.hibernate.exception.GenericJDBCException: could not insert
org.<em>hibernate</em>.exception.GenericJDBCException: <em>could</em> not <em>insert</em>rn最好详细些,如果能辅导一下下,刚刚接触hiernate,直接,简单,明了的可以吗?我的,头大。。。
org.hibernate.exception.GenericJDBCException: could not insert: [cn.itcast.bean.
今天编写框架集成过程中,遇到的问题,求大神啊!rnjavax.servlet.ServletException: org.<em>hibernate</em>.exception.GenericJDBCException: <em>could</em> not <em>insert</em>: [cn.itcast.bean.Person]rn org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:520)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:427)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnroot causernrnorg.<em>hibernate</em>.exception.GenericJDBCException: <em>could</em> not <em>insert</em>: [cn.itcast.bean.Person]rn org.<em>hibernate</em>.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)rn org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:128)rn org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)rn org.<em>hibernate</em>.id.<em>insert</em>.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)rn org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2329)rn org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2836)rn org.<em>hibernate</em>.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)rn org.<em>hibernate</em>.engine.ActionQueue.execute(ActionQueue.java:268)rn org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)rn org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)rn org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)rn org.<em>hibernate</em>.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179)rn org.<em>hibernate</em>.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135)rn org.<em>hibernate</em>.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)rn org.<em>hibernate</em>.impl.SessionImpl.firePersist(SessionImpl.java:800)rn org.<em>hibernate</em>.impl.SessionImpl.persist(SessionImpl.java:774)rn org.<em>hibernate</em>.impl.SessionImpl.persist(SessionImpl.java:778)rn cn.itcast.service.impl.PersonServiceBean.save(PersonServiceBean.java:35)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)rn org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rn org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn $Proxy21.save(Unknown Source)rn cn.itcast.web.action.PersonManageAction.add(PersonManageAction.java:23)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)rn org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
iOS Xcode, 解决“Could not insert new outlet connection: Could not find any information for the class n
在Xcode中,我们可以在StoryBoard编辑界面或者是xib编辑界面中通过“Control键+拖拽“的方式将某个界面元素和对应的代码文件连接起来,在代码文件中创建outlet。不过,如果你的运气不太好,执行以上操作的过程中你可能会遇到下面这样的错误:Could not <em>insert</em> new outlet connection: Could not find any information f...
求大神指教:constraint [null];could not insert
抛出的错误: 3!!!!!@@@247 asdfa dsafafdsaddfafdsasdfasdfsa 陈真 软件设计大赛 <em>could</em> not <em>insert</em>: ; SQL ; constraint
Xib文件拖控件关联时候报错:“Could not insert new outlet connection”
Xib文件拖控件关联时候报错:“Could not <em>insert</em> new outlet connection”0、引子: 使用Xib部署好控件之后,进行关联控件的时候,报错了,报错内容:“Could not <em>insert</em> new outlet connection”。上网搜了下,只是说了解决方法,原因没有提到。这边,我也没有做过多的探讨,只是根据自己的项目情况进行了大致的推测,我这个项目,
insmod: ERROR: could not insert module module.ko: Invalid parameters
关于向内核插入模块的时候,遇到了这个错误,起初一直怀疑是insmod使用不正确,或是内核版本不支持,后来发现有两个方面的原因: 一:需要将生成的 .ko 文件拷贝到 /lib/modules/4.4.0-21-generic 下。(如果使用 modprobe) 二:不要使用名字module ,换成hello就好了 使用 dmesg 查看自开机以来的信息就可以看到printk输出的信息了;
插入模块出现Error: could not insert module testsecond.ko: Device or resource busy
今天是自己写的第二个设备驱动程序,很不幸,中枪了 在insmod  xxx.ko 时候总是出现Error: <em>could</em> not <em>insert</em> module testsecond.ko: Device or resource busy
采用hibernate insert的问题,急
[color=#FF0000]第三个参数qwrs是 integer类型数据,[/color]jt.setJobdate(java.sql.Date.valueOf(jobdate));rnjt.setModel(model);rn System.out.println("qwrs "+qwrs+" "+Integer.valueOf(qwrs));rn[color=#0000FF]jt.setQwrs(Integer.valueOf(qwrs));[/color]rnjt.setQwsj(Double.valueOf(qwsj));rnjt.setQwsjxjh(Double.valueOf(qwsjxjh));rnjt.setQwsjxjm(Double.valueOf(qwsjxjm));rnjt.setTotal(Double.valueOf(total));rnrn[color=#FF0000]在jsp页面输入101,save时出现下面的错误,请高手看看是什么原因造成的?[/color]rn2008-11-7 14:28:58 com.opensymphony.xwork2.validator.ActionValidatorManagerFactory rn信息: Detected AnnotationActionValidatorManager, initializing it...rn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Environment rn信息: Hibernate 3.1rn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Environment rn信息: <em>hibernate</em>.properties not foundrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Environment rn信息: using CGLIB reflection optimizerrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Environment rn信息: using JDK 1.4 java.sql.Timestamp handlingrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Configuration configurern信息: configuring from resource: /<em>hibernate</em>.cfg.xmlrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Configuration getConfigurationInputStreamrn信息: Configuration resource: /<em>hibernate</em>.cfg.xmlrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Configuration addResourcern信息: Reading mappings from resource: model.hbm.xmlrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.HbmBinder bindRootPersistentClassCommonValuesrn信息: Mapping class: tables.model -> modelrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Configuration addResourcern信息: Reading mappings from resource: jobTime.hbm.xmlrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.HbmBinder bindRootPersistentClassCommonValuesrn信息: Mapping class: tables.jobTime -> JobTimern2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Configuration doConfigurern信息: Configured SessionFactory: nullrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Configuration secondPassCompilern信息: processing extends queuern2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Configuration secondPassCompilern信息: processing collection mappingsrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Configuration secondPassCompilern信息: processing association property referencesrn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.Configuration secondPassCompilern信息: processing foreign key constraintsrn2008-11-7 14:28:58 org.<em>hibernate</em>.connection.DriverManagerConnectionProvider configurern信息: Using Hibernate built-in connection pool (not for production use!)rn2008-11-7 14:28:58 org.<em>hibernate</em>.connection.DriverManagerConnectionProvider configurern信息: Hibernate connection pool size: 20rn2008-11-7 14:28:58 org.<em>hibernate</em>.connection.DriverManagerConnectionProvider configurern信息: autocommit mode: falsern2008-11-7 14:28:58 org.<em>hibernate</em>.connection.DriverManagerConnectionProvider configurern信息: using driver: org.postgresql.Driver at URL: jdbc:postgresql://localhost/testtestrn2008-11-7 14:28:58 org.<em>hibernate</em>.connection.DriverManagerConnectionProvider configurern信息: connection properties: user=postgres, password=****rn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: RDBMS: PostgreSQL, version: 8.3.3rn2008-11-7 14:28:58 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC4 with SSL (build 603)rn2008-11-7 14:28:59 org.<em>hibernate</em>.dialect.Dialect rn信息: Using dialect: org.<em>hibernate</em>.dialect.PostgreSQLDialectrn2008-11-7 14:28:59 org.<em>hibernate</em>.transaction.TransactionFactoryFactory buildTransactionFactoryrn信息: Using default transaction strategy (direct JDBC transactions)rn2008-11-7 14:28:59 org.<em>hibernate</em>.transaction.TransactionManagerLookupFactory getTransactionManagerLookuprn信息: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)rn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Automatic flush during beforeCompletion(): disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Automatic session close at end of transaction: disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: JDBC batch size: 15rn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: JDBC batch updates for versioned data: disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Scrollable result sets: enabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: JDBC3 getGeneratedKeys(): disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Connection release mode: autorn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Default batch fetch size: 1rn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Generate SQL with comments: disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Order SQL updates by primary key: disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory createQueryTranslatorFactoryrn信息: Query translator: org.<em>hibernate</em>.hql.ast.ASTQueryTranslatorFactoryrn2008-11-7 14:28:59 org.<em>hibernate</em>.hql.ast.ASTQueryTranslatorFactory rn信息: Using ASTQueryTranslatorFactoryrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Query language substitutions: rn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Second-level cache: enabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Query cache: disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory createCacheProviderrn信息: Cache provider: org.<em>hibernate</em>.cache.EhCacheProviderrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Optimize cache for minimal puts: disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Structured second-level cache entries: disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Echoing all SQL to stdoutrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Statistics: disabledrn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Deleted entity synthetic identifier rollback: disabledrnqwrs 101 101rnHibernate: select nextval ('JobTime_jobID_seq')rnHibernate: <em>insert</em> into JobTime (jobdate, model, qwrs, qwsj, cysj, qwsjxjh, cysjxjh, qwsjxjm, cysjxjm, total, jobid) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)rn2008-11-7 14:28:59 org.<em>hibernate</em>.cfg.SettingsFactory buildSettingsrn信息: Default entity-mode: pojorn2008-11-7 14:28:59 org.<em>hibernate</em>.impl.SessionFactoryImpl rn信息: building session factoryrn2008-11-7 14:28:59 net.sf.ehcache.config.Configurator configurern警告: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/EfficiencyM/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xmlrn2008-11-7 14:28:59 org.<em>hibernate</em>.impl.SessionFactoryObjectFactory addInstancern信息: Not binding factory to JNDI, no JNDI name configuredrn2008-11-7 14:28:59 org.<em>hibernate</em>.impl.SessionFactoryImpl checkNamedQueriesrn信息: Checking 0 named HQL queriesrn2008-11-7 14:28:59 org.<em>hibernate</em>.impl.SessionFactoryImpl checkNamedQueriesrn信息: Checking 0 named SQL queriesrn2008-11-7 14:28:59 org.<em>hibernate</em>.type.NullableType nullSafeSetrn[color=#0000FF]信息: <em>could</em> not bind value '101' to parameter: 3[/color]2008-11-7 14:28:59 org.<em>hibernate</em>.util.JDBCExceptionReporter logExceptionsrn警告: SQL Error: 0, SQLState: 22023rn2008-11-7 14:28:59 org.<em>hibernate</em>.util.JDBCExceptionReporter logExceptionsrn[color=#0000FF]严重: 未设定参数值 3 的内容。[/color]rn2008-11-7 14:28:59 org.<em>hibernate</em>.event.def.AbstractFlushingEventListener performExecutionsrn严重: Could not synchronize database state with sessionrnorg.<em>hibernate</em>.exception.DataException: Could not execute JDBC batch update
hibernate : Not Supported for DML Operation
我用MyEclipse hql 插件 执行 “updata TSendTask t set t.sendFlag = 1 wherer t.sendTask=1” 出错
急问hibernate配置问题
配置habernate的问题rn在tools\bin\下运行 hbm2java d:\ff\*.xml --output=d:\ddrn时出现 FILES\APACHErn不知道是哪的错,异常说没找到这个类
HIBERNATE急问!
create table emp(rn empno varchar(32),rn ename varchar(10) not null,rn eage int,rn esex varchar(2),rn deptno varchar(32),rn [color=#FF0000]foreign key (empno) references dept (deptno) on delete cascade[/color]rn);rncreate table dept(rn deptno varchar(32) not null primary key,rn dname varchar(30) not null,rn loc varchar(30),rn business varchar(60)rn);rn 以上是我的数据库创建脚本(MYSQL).rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn [color=#FF0000]rn rn [/color] rnrn rnrnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn [color=#FF0000]rn rn rn rn rn [/color] rn rnrnrn以上是我的HIBERANTE映射文件!rnpackage demo.gyl.vo;rnrnimport demo.gyl.dao.DeptDAO;rnimport demo.gyl.factory.DAOFactory;rnpublic class Test rnrn /**rn * @param argsrn */rn public static void main(String[] args) rn DeptDAO dd=DAOFactory.getDeptDAOImplInstance();rn Dept d=new Dept();rn Emp emps =new Emp();rn emps.setEage(12);rn emps.setEname("gyl2005");rn emps.setEsex("男");rn rn d.setBusiness("活动推广");rn d.setDname("gyl2005");rn d.setLoc("loc");rn emps.setDept(d);rn d.getEmps().add(emps);rn try rn dd.<em>insert</em>(d);rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn /*try rn dd.delete("402881e618f03b160118f03b1a7d0002");rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn */rn rnrnrn以上为测试代码!rnHibernate: <em>insert</em> into gyl.dept (dname, loc, business, deptno) values (?, ?, ?, ?)rnHibernate: <em>insert</em> into gyl.emp (ename, eage, esex, deptno, empno) values (?, ?, ?, ?, ?)rnlog4j:WARN No appenders <em>could</em> be found for logger (org.<em>hibernate</em>.cfg.Environment).rnlog4j:WARN Please initialize the log4j system properly.rnorg.<em>hibernate</em>.exception.ConstraintViolationException: Could not execute JDBC batch updatern at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:71)rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.<em>hibernate</em>.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)rn at org.<em>hibernate</em>.engine.ActionQueue.executeActions(ActionQueue.java:235)rn at org.<em>hibernate</em>.engine.ActionQueue.executeActions(ActionQueue.java:139)rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)rn at org.<em>hibernate</em>.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)rn at org.<em>hibernate</em>.impl.SessionImpl.flush(SessionImpl.java:985)rn at org.<em>hibernate</em>.impl.SessionImpl.managedFlush(SessionImpl.java:333)rn at org.<em>hibernate</em>.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)rn at demo.gyl.impl.DeptDAOImpl.<em>insert</em>(DeptDAOImpl.java:30)rn at demo.gyl.vo.Test.main(Test.java:24)rn[color=#FF0000]Caused by: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`gyl/emp`, CONSTRAINT `emp_ibfk_1` FOREIGN KEY (`empno`) REFERENCES `dept` (`deptno`) ON DELETE CASCADE)[/color]rn at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:648)rn at org.<em>hibernate</em>.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)rn at org.<em>hibernate</em>.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)rn ... 9 morern以上是错误信息!rnrn请达人帮忙看看这个问题怎么解决!
ubuntu 16.04 virtualbox could not insert 'vboxdrv': Required key not available 问题解决方法
参考:https://askubuntu.com/questions/760671/<em>could</em>-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur从 内核版本 4.4.0-20 开始,在开启了 Secure Boot 的电脑上,未注册的 kernel 模块不再允许执行,所以如果想在保持 Secure Boot
Ubuntu14.04安装CUDA8.0报错could not insert 'nvidia_367_uvm':Invalid argument
继AMAX 服务器双系统装机+TITAN X 显卡驱动装好之后 安装CUDA8.0折腾总结 到官网下载适合自己系统的CUDA8.0安装包.(有.deb和.run两种形式),推荐下载.run形式,可以自行决定是否安装NVIDIA DRIVER,因为deb文件在安装的过程中会自动安装NVIDIA GPU DRIVER,而我已经在上一篇博文中记录了如何安装好最新的显卡驱动,所以此处选择run
iOS Xcode, 解决“Could not insert new outlet connection”的问题。
在Xcode中,我们可以在StoryBoard编辑界面或者是xib编辑界面中通过“Control键+拖拽“的方式将某个界面元素和对应的代码文件连接起来,在代码文件中创建outlet。 不过,如果你的运气不太好,执行以上操作的过程中你可能会遇到下面这样的错误: Could not <em>insert</em> new outlet connection: Could not find any informatio...
Error: E0501 : E0501: Could not perform authorization operation, User: root is not allowed to impers
修改hadoop的配置文件core-site.xml     &amp;lt;property&amp;gt;         &amp;lt;name&amp;gt;hadoop.proxyuser.root.hosts&amp;lt;/name&amp;gt;         &amp;lt;value&amp;gt;*&amp;lt;/value&amp;gt;     &amp;lt;/property&amp;gt;     &amp;lt;property&amp;gt;         &
hibernate做页面注册报这样错误 could not insert: [com.sxt.po.User]
-
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation:
大家好,我在整合SSH框架时 保存数据时一提交就报下面的错误,请大家指导一下 ,spring 2.5,<em>hibernate</em>3.2,structs2,用的mysql,jar包是mysql-connector-java-5[1].0.3-bin.jar,报错如下:rnexception rnrnjavax.servlet.ServletException: org.springframework.jdbc.UncategorizedSQLException: Hibernate <em>operation</em>: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:mysql://localhost:3306/mytest'; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:mysql://localhost:3306/mytest'rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)rn org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)rnrnrnroot cause rnrnorg.springframework.jdbc.UncategorizedSQLException: Hibernate <em>operation</em>: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:mysql://localhost:3306/mytest'; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:mysql://localhost:3306/mytest'rn org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:120)rn org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276)rn org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)rn org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)rn org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.execute(HibernateTemplate.java:377)rn org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.save(HibernateTemplate.java:632)rnrn
急问一个小问题:Invalid pointer operation
我有两个窗口Form1跟Form2,其中Form1的按钮点击后rnprocedure TForm1.FlatButton2Click(Sender: TObject);rnbeginrn application.createform(Tform2,form2);rn Form2.ShowModal;rnend;rnrnrnrnrnForm2里面有个小小的数据库,(Picturename,X,Y三项)用于控制窗口显示的时候载入哪张图片及图片的坐标rnrn Image: array of TImage;rnrnrnprocedure TForm2.FormShow(Sender: TObject);rnvarrn Rec_count:Integer;rnbeginrn with ADOTable1 dorn beginrn tryrn First;rn while not Eof dorn beginrn Rec_count:=ADOTable1.RecNo;rn Image[Rec_count]:= Timage.Create(nil);rn Image[Rec_count].Picture.LoadFromFile('.\Sprite\'+ADOTable1['Sprite_Name']+'.bmp');rn Image[Rec_count].Parent:= PaintBox1.Parent;rn Image[Rec_count].Left:= ADOTable1['X'];rn Image[Rec_count].Top:= ADOTable1['Y'];rn Image[Rec_count].Transparent:=true;rn Image[Rec_count].Autosize:=true;rn Next;rn end;rn finallyrn end;rn end;rnend;rnrn运行结果没问题,但是再退出窗口的时候就问题来了,关第一个窗口的时候没问题,关第二个窗口的时候提示 Invalid pointer <em>operation</em>,我点了确定,再按一次F9,变成了Access violation at address 004C7EFD in module.....rnrn请问是怎么回事哦 ?我想加个rnfor i:= 1 to MaxRecod1 dorn beginrn Image[i].free;rn end;rn但是不知道加在Form1 的FormDestroy还是form2的,我都试过,都是不行的
Vs.net不能新建项目,报错Operation could not complete!
Vs.net不能新建项目,报错Operation <em>could</em> not complete!
hibernate could not commit
HIBERNATE在运行一段时间后出现<em>could</em> not commit的异常,有时候还会有<em>could</em> not query的异常一起出现。请问有可能是什么问题?
Could not commit Hibernate transaction
[img=https://img-bbs.csdn.net/upload/201311/20/1384947185_798963.jpg][/img][img=https://img-bbs.csdn.net/upload/201311/20/1384947195_226918.png][/img][img=https://img-bbs.csdn.net/upload/201311/20/1384947296_520329.png][/img]大家看,这是啥错。struts2+Spring+<em>hibernate</em>+Mysql+linux+tomcat的组合。辛苦各位啦
org.hibernate.exception.ConstraintViolationException: could not insert
org.<em>hibernate</em>.exception.ConstraintViolationException: <em>could</em> not <em>insert</em> 报错原因: generator id设置问题 <em>hibernate</em>的映射文件bean.hbm.xml是跟库表一一对应的,如果库表中存在
insert new outlet connection"问题">Xcode的"Could not insert new outlet connection"问题
Xcode的”Could not <em>insert</em> new outlet connection”问题在拉动storyboard和class控件时候,可能出现下面情况。 应该算是XCODE的BUG吧,用下面的方法就可以解决: 关闭XCODE 进入xcode的DerivedData文件夹 文件夹地址/Users/###/Library/Developer/XCode/DerivedData ###代表
初学hibernate用原生SQL 或 save方法进行insert操作+jQuery制作简易留言板+Unknown Entity报错
知识点:1,hql是没有直接<em>insert</em>的语句2,使用<em>hibernate</em>对数据库(postgresql)进行插入数据操作(法一:原生SQL的<em>insert</em>;法二:<em>hibernate</em>自带save方法)3,设置主键自增4,mapping报错Unknown Entity(情况一:设置@Entity映射是导错jar;情况二:未向配置文件cfg.xml加入映射文件hbm.xml;情况三:一个project里生...
hibernate如何执行sql语句的insert动作?
如题。
hibernateinsert和update控制实战
<em>hibernate</em>的<em>insert</em>和update语句各种情况控制实例
hibernate could not execute query?
大家好:rnrn 我在运行一个WEB应用程序(原来在公司机器上可以运行)时,tomcat启动后,访问登录页,输入用户名和密码后,点登录,tomcat报错如下:rnhttp-8080-Processor25 INFO - Tiles definition factory found for request processor ''.rnhttp-8080-Processor25 INFO - Initializing, config='org.apache.struts.actions.LocalStrings', returnNull=truernHibernate: select user0_.ID as ID0_, user0_.LOGINNAME as LOGINNAME0_, user0_.LOGINPASSWORD as LOGINPAS3_0_, user0_.SURENAME as SURENAME0_, user0_.SEX as SEX0_, user0_.ISDELETE as ISDELETE0_, user0_.OFFICEADDRESS as OFFICEAD7_0_, user0_.EMAIL as EMAIL0_, user0_.OFFICETELL as OFFICETELL0_, user0_.DEPT as DEPT0_, user0_.DUTY as DUTY0_, user0_.MOBILE as MOBILE0_, user0_.TELL as TELL0_, user0_.BLOG as BLOG0_, user0_.INDIVIDUATION as INDIVID15_0_, user0_.IMAGE as IMAGE0_, user0_.WEIGHT as WEIGHT0_, user0_.ACTIVITY as ACTIVITY0_, user0_.ISLEADER as ISLEADER0_ from TBLUSERS user0_ where user0_.LOGINNAME='ZhangSan' and user0_.ISDELETE=0rnhttp-8080-Processor25 WARN - SQL Error: -204, SQLState: 42704rnhttp-8080-Processor25 ERROR - DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: DB2ADMIN.TBLUSERSrnhttp-8080-Processor25 WARN - SQL Error: -727, SQLState: 56098rnhttp-8080-Processor25 ERROR - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;DB2ADMIN.TBLUSERSrnhttp-8080-Processor25 WARN - SQL Error: -727, SQLState: 56098rnhttp-8080-Processor25 ERROR - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;DB2ADMIN.TBLUSERSrnhttp-8080-Processor25 WARN - Unhandled Exception thrown: class org.<em>hibernate</em>.exception.SQLGrammarExceptionrnjavax.servlet.ServletException: <em>could</em> not execute queryrn at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)rn请大家帮忙分析一下?rn万分感谢!
Hibernate could not execute query
Hibernate 的配置如下:rnrnrn rn com.mysql.jdbc.Driverrn jdbc:mysql://localhost/testrn rootrn rootrn 2rn truern 50 rn 25 rn false org.<em>hibernate</em>.dialect.MySQLDialectrn rn rn rn rn rnrnrnrn测试方法:rn rnprivate void test()rn Session session = HibernateUtil.currentSession();rn Transaction tx = session.beginTransaction();rn Event theEvent = new Event();rn theEvent.setTitle("ddd");rn theEvent.setDate(new Date());rn Long id = (Long) session.save(theEvent);rn Event event = (Event)session.load(Event.class,id);rn rn rn System.out.println(event.getId());rn System.out.println(event.getTitle());rn System.out.println(event.getDate());rn rn List result = session.createQuery("from Event").list();rn rn tx.commit();rn HibernateUtil.closeSession();rn rnrn为了说明问题才把测试代码写成这样。rnrn问题:rnrn去掉List result = session.createQuery("from Event").list();就能正确执行rnrn执行List result = session.createQuery("from Event").list();的时候rn出错信息是:rnrnHibernate: select event0_.EVENT_ID as EVENT1_, event0_.EVENT_DATE as EVENT2_0_, event0_.title as title0_ from EVENTS event0_rn17:40:18,793 WARN JDBCExceptionReporter:71 - SQL Error: 1421, SQLState: HY000rn17:40:18,793 ERROR JDBCExceptionReporter:72 - The statement (3) has no open cursor.rnorg.<em>hibernate</em>.exception.GenericJDBCException: <em>could</em> not execute queryrnrn
hibernate 中的could not deserialize
<em>hibernate</em> 中报这样的错误:<em>could</em> not deserializern网上说没有实现Serializable但是我那个已经实现那了:rnpublic class ForumItemViewVOrn implements Serializablern
hibernate could not execute query
Topic: <em>hibernate</em> <em>could</em> not execute query问题 rn Print this page rnrn--------------------------------------------------------------------------------rn1.<em>hibernate</em> <em>could</em> not execute query问题 Copy to clipboard rnPosted by: zilanfeixuernPosted on: 2006-11-27 09:44rnrn在一个系统的登陆校验中,有时候刚登上系统(对数据库进行第一次查询)就会抛错并且产生一个<em>could</em> not execute query的提示。但是代码是可用的,多刷新几次就可以正常使用了。rn请问哪位也有碰到这样的现象,或能告诉我是怎么回事吗?rn谢谢。 rnrn--------------------------------------------------------------------------------rn2.Re:<em>hibernate</em> <em>could</em> not execute query问题 [Re: zilanfeixue] Copy to clipboard rnPosted by: zilanfeixuernPosted on: 2006-11-28 12:08rnrn有人在乜。。。。。 rnrn--------------------------------------------------------------------------------rn3.Re:<em>hibernate</em> <em>could</em> not execute query问题 [Re: zilanfeixue] Copy to clipboard rnPosted by: sljsuperrnPosted on: 2006-12-05 15:34rnrn以前用<em>hibernate</em>2做过一个项目也出现过类似问题,后来用3就OK了,不知道是不是<em>hibernate</em>的bug。 rnrn--------------------------------------------------------------------------------rn4.Re:<em>hibernate</em> <em>could</em> not execute query问题 [Re: zilanfeixue] Copy to clipboard rnPosted by: zilanfeixuernPosted on: 2006-12-08 15:38rnrn我现在就是用的3的啊。还是这样子。rn页面开始是可以访问的,用一段时间后就连接不上了。产生org.<em>hibernate</em>.exception.JDBCConnectionException: <em>could</em> not execute queryrn具体:rntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.<em>hibernate</em>.exception.JDBCConnectionException: <em>could</em> not execute queryrn org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:74)rn org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn org.<em>hibernate</em>.loader.Loader.doList(Loader.java:2148)rn org.<em>hibernate</em>.loader.Loader.listIgnoreQueryCache(Loader.java:2029)rn org.<em>hibernate</em>.loader.Loader.list(Loader.java:2024)rn org.<em>hibernate</em>.loader.hql.QueryLoader.list(QueryLoader.java:375)rn org.<em>hibernate</em>.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)rn org.<em>hibernate</em>.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)rn org.<em>hibernate</em>.impl.SessionImpl.list(SessionImpl.java:1106)rn org.<em>hibernate</em>.impl.QueryImpl.list(QueryImpl.java:79)rn servlet.UserCheckServlet.doUserVerifyEx(UserCheckServlet.java:50)rn servlet.UserCheckServlet.doPost(UserCheckServlet.java:29)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn filter.EncodeFilter.doFilter(EncodeFilter.java:12)rnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs. rn
信息: org.hibernate.exception.DataException: could not insert: [com.smelt.core.hibernate.po.Article]
DataException是什么异常,如何解决呢?
用数据源的hibernate 拼接insert SQL 语句
关于<em>hibernate</em> 的拼接sql语句在网上查了很多,但关于<em>insert</em>的确不是很多,将这些记录下来。 在插入语句的时候: // 此SQL语句因数据库字段类型而定,两种方式前面为NUMBER类型,后面为字符串类型 String sql ="INSERT INTO TABLE"+"(PARAM1,PARAM2) VALUES("PARAM1",'"+PARAM2+"')"; 在插入语句的时
hibernate dynamic-insert="true"
-
Hibernate之使用insert into语句
public void <em>insert</em>IntoCMS(Agent agent) { Session session = this.getSession(); session.save(agent); ConfigInfo configInfo = new ConfigInfo(); String roleid = configInfo.getPropertiesValue("parameter","
hibernate Hql insert into插入问题
因为Hibernate的HQL语言是用于面向对象实现查询功能的,然而在插入操作中是不会牵涉任何查询动作的,所以HQL不能用于<em>insert</em>语句的插入操作,而select、update、delete语句都可以有可能的查询实现
急问 Could not initialize class的错误
运行客户端,出现如下提示:rnorg.apache.axis2.AxisFault: Could not initialize class com.test.RayDataSourcern at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)rn at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)rn at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)rn at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)rn at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)rn at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548)rn at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)rn at com.raymond.axis2.client.SendClient.upload(SendClient.java:89)rn at com.raymond.axis2.client.SendClient.main(SendClient.java:285)rnException in thread "main" java.lang.NullPointerExceptionrn at com.raymond.axis2.client.SendFaxClient.main(SendFaxClient.java:293)rnrn请问,这个应该怎么解决,谢谢。
Could not found jar: Hibernate?
官网下的zip..……为什么呢? 结果如图:rn
急问Hibernate的多对多关系?
-- 小组rnTeam(id INT)rnrn-- 人员rnPerson( id INT )rnrn-- 工作rnJob(id INT)rnrn-- 小组和人员的多对多关系rnTeam_Person(rn teamId INT,rn personId INT,rn FOREIGN KEY(teamId) REFERENCES Team(id),rn FOREIGN KEY(personId) REFERENCES Person(id)rn)rnrn--人员和工作的多对多关系rnPerson_Job(rn personId INT,rn jobId INT,rn FOREIGN KEY(personId) REFERENCES Person(id),rn FOREIGN KEY(jobId) REFERENCES Job(id)rn)rnrnrn以上就是数据库,rnrnrn我自己定义了一些Dao,请问如何得到一个Team下的人从事的所有工作?rnpublic List getJobs(Team team)rn // TODO: rn
急问hibernate插入问题
插入时总显示将截断二进制串(但绝对不是字段超长)rn具体插入代码如下:rn调用代码如下:rnaccountFacade facade=new accountFacade(); rnAccount a=new Account(); rna.setId("a1"); rna.setAname("aaa");rnrnAccountFacade代码:rnpackage com.mccs.database.anExample;rn//<em>hibernate</em> packagernimport net.sf.<em>hibernate</em>.SessionFactory;rnimport net.sf.<em>hibernate</em>.Transaction;rnimport net.sf.<em>hibernate</em>.Session;rnimport net.sf.<em>hibernate</em>.HibernateException;rnimport net.sf.<em>hibernate</em>.Query;rnrn//persistence packagernimport com.mccs.persistence.Account;rnrn//jdk utility packagernimport java.util.List;rnrn//project packagernimport com.mccs.database.Datamoudle;rnimport com.mccs.database.DatamoudleMain;rnrnpublic class accountFacade rn //每个facade模块中必须声明数据库模块和session工厂两个变量rn //并且在构造函数中使用rn private Datamoudle dataMoudle;rn private SessionFactory sessionFactory;rn public accountFacade() throws HibernateException rn this.dataMoudle = new DatamoudleMain();rn this.sessionFactory = this.dataMoudle.getSessionFactory();rn rnrn public Account findbyAccountName(String accountName) throwsrn HibernateException rn Transaction transaction = null;rn Account account = new Account();rn Session session = this.sessionFactory.openSession();rn String queryString =rn "from com.mccs.persistence.Account as a where a.aname='";rn queryString += accountName + "'";rn try rn transaction = session.beginTransaction();rn Query query = session.createQuery(queryString);rn List list = query.list();rn account = (Account) list.get(0);rn transaction.commit();rn rn finally rn session.close();rn rn return account;rn rn // have an error that has no solutionrn public void <em>insert</em>(Account account) throws HibernateException rn Transaction transaction = null;rn Session session = this.sessionFactory.openSession();rn try rn transaction = session.beginTransaction();rn System.out.print("ano = "+account.getId());rn session.save(account);rn session.flush();rn transaction.commit();rn rn catch(Exception e)rn e.printStackTrace();rn rn finally rn session.close();rn rn rnrn public void delete(Account account) throws HibernateException rn Transaction transaction = null;rn Session session = this.sessionFactory.openSession();rn try rn transaction = session.beginTransaction();rn session.delete(account);rn transaction.commit();rn rn finally rn session.close();rn rn rnrnrn
hibernate 执行insert 语句问题, 急!!!
[code=sql]<em>insert</em> into Position (processDate,restrictedFlag,localCcy) select processDate,restrictedFlag,localCcy from Position where processDate=:proDate;[/code]rnrn这样执行没有问题, 就是把我用processDate查询出来的全部复制并插入数据库, 但是我需求是要对这个日期天数+1再保存, 也就是说我想把select 后面的processDate写死为我计算后的一个date,但是没办法通过设置参数传进去 select :newDate 如果这样写是直接报错的 ,用字符串(select '2012-01-02')又说类型不匹配rn又遇到这个问题的么????
Hibernate中如何执行insert语句
Hibernate中执行save(o)方法会自动生成ID序列,现在要手工插入一条ID为60的记录,如何执行? 我用的 final Object o = new String {bulletin.get
hibernate save的时候怎么知道到底要Insert还是update?
<em>hibernate</em> save的时候怎么知道到底要Insert还是update? 难道首次去执行的时候 他还select一次?
hibernate怎么执行SQL的insert操作(不是HQL哦,是SQL语句)
我的代码是这样的: public int <em>insert</em>Value(int pid,String vcode,String vvalue,String state,String mname){ int
hibernate 怎么批量insert啊??
做的一个web作业 工资模块 员工一张表 工资一张表 页面上把员工显示出来 如果说有10条 在每条后面填上工资项(比如奖金 罚款 基本工资) 提交后 10条数据全部添加到数据库里 求助这怎么写啊 数据
hibernate insert
        Session session = null;        Transaction transaction = null;        PreparedStatement pstmt = null;        Statement stmt = null;        ResultSet resultSet = null;        try{            se
hibernate执行insert操作出错,急!
<em>hibernate</em>配置如下:rn rnrnrnrn rn jdbc:mysql://localhost/shurn org.gjt.mm.mysql.Driverrn <em>hibernate</em>rn <em>hibernate</em>rn rnrn rn net.sf.<em>hibernate</em>.dialect.MySQLDialectrnrn truern truern net.sf.<em>hibernate</em>.transaction.JDBCTransactionFactoryrn java:comp/UserTransactionrn rn rnrn rnrnrn生成的ORM文件:rn import java.io.Serializable;rnimport org.apache.commons.lang.builder.ToStringBuilder;rnpublic class TteacherInfo implements Serializable rn private Integer empId;rn private String firstName;rn public TteacherInfo(String firstName) rn this.firstName = firstName;rn rn public TteacherInfo() rn rnrn public Integer getEmpId() rn return this.empId;rn rnrn public void setEmpId(Integer empId) rn this.empId = empId;rn rnrn public String getFirstName() rn return this.firstName;rn rnrn public void setFirstName(String firstName) rn this.firstName = firstName;rn rnrnrn对应的hbm文件如下:rnrnrn rnrnrnrnrn rn @<em>hibernate</em>.classrn table="t_teacher_info"rn schema="shu"rn dynamic-update="true"rn dynamic-<em>insert</em>="true"rn select-before-update="true"rn rnrn rn rn @<em>hibernate</em>.idrn generator-class="native"rn type="java.lang.Integer"rn column="EMP_ID"rn rn rn rnrn rn rn @<em>hibernate</em>.propertyrn column="first_name"rn length="20"rn not-null="true"rn rn rnrnrn我想junit测试一下,测试文件如下:rnimport java.util.List;rnrnimport junit.framework.TestCase;rnimport net.sf.<em>hibernate</em>.HibernateException;rnimport net.sf.<em>hibernate</em>.Session;rnimport net.sf.<em>hibernate</em>.SessionFactory;rnimport net.sf.<em>hibernate</em>.cfg.Configuration;rnrnimport org.apache.log4j.Logger;rnrnimport cn.edu.shu.data.TteacherInfo;rnrnrn/**rn * @author sunqiangrn * rn * TODO To change the template for this generated type comment go to Window -rn * Preferences - Java - Code Style - Code Templatesrn */rnpublic class TestHibernate extends TestCase rnrn Session session = null;rnrn Logger log = Logger.getLogger(this.getClass());rnrn public static void main(String[] args) rn rnrn /*rn * @see TestCase#setUp()rn */rn protected void setUp() throws Exception rn try rn Configuration config = new Configuration().configure();rn rn// Configuration config = new Configuration();rn// rn// config.addClass(TteacherInfo.class);rnrn SessionFactory sessionFactory = config.buildSessionFactory();rnrn session = sessionFactory.openSession();rn catch (HibernateException e) rn e.printStackTrace();rn rn rnrn /*rn * @see TestCase#tearDown()rn */rn protected void tearDown() throws Exception rn try rn session.close();rn catch (HibernateException e) rn e.printStackTrace();rn rn rnrn public void testInsert() rn try rn TteacherInfo info = new TteacherInfo();rnrn info.setAge(23);rn info.setFirstName("minggen");rn session.save(info);rn session.flush();rn catch (HibernateException e) rn e.printStackTrace();rn rn rnrnrnrn报错:Hibernate: <em>insert</em> into shu_t_teacher_info (first_name) values (?)rnnet.sf.<em>hibernate</em>.exception.SQLGrammarException: <em>could</em> not <em>insert</em>: [data.TteacherInfo]rn at net.sf.<em>hibernate</em>.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:69)rn at net.sf.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)rn at net.sf.<em>hibernate</em>.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331)rn at net.sf.<em>hibernate</em>.persister.EntityPersister.<em>insert</em>(EntityPersister.java:540)rn at net.sf.<em>hibernate</em>.persister.EntityPersister.<em>insert</em>(EntityPersister.java:423)rn at net.sf.<em>hibernate</em>.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:28)rn at net.sf.<em>hibernate</em>.impl.SessionImpl.execute(SessionImpl.java:2449)rn at net.sf.<em>hibernate</em>.impl.SessionImpl.doSave(SessionImpl.java:943)rn at net.sf.<em>hibernate</em>.impl.SessionImpl.doSave(SessionImpl.java:868)rn at net.sf.<em>hibernate</em>.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:786)rn at net.sf.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:749)rn at cn.edu.shu.test.TestHibernate.testInsert(TestHibernate.java:75)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at junit.framework.TestCase.runTest(TestCase.java:154)rn at junit.framework.TestCase.runBare(TestCase.java:127)rn at junit.framework.TestResult$1.protect(TestResult.java:106)rn at junit.framework.TestResult.runProtected(TestResult.java:124)rn at junit.framework.TestResult.run(TestResult.java:109)rn at junit.framework.TestCase.run(TestCase.java:118)rn at junit.framework.TestSuite.runTest(TestSuite.java:208)rn at junit.framework.TestSuite.run(TestSuite.java:203)rnrn请问这是什么地方没有配置好造成的?
急问:insert数据的错误处理问题
问题如下:rn目标表有主键&外键约束rn使用sql语句一次<em>insert</em> 多条记录rn若其中有错误记录rn则过滤到err表中rn将无问题的记录写入目标表中.rnrn以前的处理方法是:rndisable constraintsrn<em>insert</em> datarnenable constraintsrn若有错误数据则最后一步会报错rn然后根据错误信息将错误记录过滤 .rnrn现在不可以disable constraintsrn请教有无 其他较好的方法可以实现以上功能(不需要修改<em>insert</em> sql的条件语句)?rn
对于要insert的值,急问!!!
<em>insert</em> into table value(1,3,"rr")rn如果value里写变量,能不能实现,如何实现?????????????rn
急问: sql 中 Insert语句的问题
编写一个程序,编译和链接都通过了,执行时出现了“from 子句语法错误”,请高手指教。。rn代码如下:rn CDatabase DataBase; //建立数据库对象rn if (!DataBase.IsOpen()) rn DataBase.Open( _T("scfee"), FALSE, FALSE, _T ("ODBC;UID=admin;PWD=xcltd"),TRUE); //打开数据库rn CTelRecordSet *TelRecordSet = new CTelRecordSet(&DataBase); //连接数据库和数据集rn CString str = CString("INSERT INTO TelRecord VALUES (1,'user','zhl',m_TeleNumber,'china',nowtime,nowtime,Time_Length.GetTotalMinutes(), '12.23', '12.21','11.34','23.56',FALSE,FALSE,'ZHL',FALSE");rn TelRecordSet->Open(CRecordset::forwardOnly,str);//TelRecord是数据库中的一个表
急问:INSERT中的类型问题
急问各位:rn ASP+oracle开发,用asp作插入rn sql_add="<em>insert</em> into wzgl_rk_cb(wzbm,dj,rksl,rkrq,cgdd,cgr,zzs,ddgysbm,jgbm,bz) values ('" & rs("wzbm") & "'," & cdbl(rs("dj")) & "," & cdbl(rs("rksl")) & "," & cdate(rs("rkrq")) & ",'" & rs("cgdd") & "','" & rs("cgr") & "'," & cdbl(rs("zzs")) & ",'" & rs("ddgysbm") & "','" & rs("jgbm")&"','"& rs("bz") & "') "rnrnresponse.write sql_add的显示为rn<em>insert</em> into wzgl_rk_cb(wzbm,dj,rksl,rkrq,cgdd,cgr,zzs,ddgysbm,jgbm,bz) values ('0610509011',128,21,2002-05-30,'商河路283号','郑伟',1,'75','08','') rnrn其中dj,rksl,zzs为数字型,rkrq为日期型,其他字段为字符型rnrn错误为Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e07' rnrn[Microsoft][ODBC driver for Oracle][Oracle]ORA-00932: inconsistent datatypes rnrn我估计是日期型和字符型区别的问题,请问各位该如何处理这个问题呢
hibernate不支持insert into values()
DML(数据操作语言)风格的操作(DML-style <em>operation</em>s) hence manipulating (using the SQL Data Manipulation Language (DML) statements: INSERT, UPDATE, DELETE) data directly in the database will not affect in-memory state. However, Hibernate provides methods for bulk
hibernate入门--实现数据简单插入
<em>hibernate</em>实现数据的简单插入 项目目录结构: 第一步:先建一张数据表Company /* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50051 Source Host : localhost:3306 Source Da
hibernate(二)
1.many to many 无主键 <!DOCTYPE <em>hibernate</em>-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.<em>hibernate</em>.org/dtd/<em>hibernate</em>-mapping-3.0.dtd
hibernate的hql不能使用insert语句
初次尝试将<em>hibernate</em>加入项目 做一个用户登录的功能 想要选择<em>hibernate</em>的hql做插入动作 发现插入式实现不了的  最后使用sql语句 session.createSQLQuery(sql); 为什么hql语句不能做插入操作呢 因为hql语句是面向对象实现查询功能的 在我们选择插入数据时并没有使用到任何的查询功能,因此导致了hql不能使用<em>insert</em>
Hibernate insert,select,update,delete方法
-------------------------------------------------------------------四种方法--------------------------------------------------------------------package com.cn.rongbin;import java.util.List;import org
operation was attempted" 二问">"an unsupported operation was attempted" 二问
程序发生错误的时候会出现这种提示:"an unsupported <em>operation</em> was attempted"rnrn我的程序加载了我的DLL,并创建了两个线程(A,B),线程A打开了DLL中的一个窗口(tdlg.DoModal();),线程B监视线程一是否结束。rnDLL中的窗口上有个按钮,按下之后创建两个线程(C,D)。线程D监视线程C是否结束。rn线程C中,一开始是一些初始化动作,之后是一个大循环,循环结束的条件是数据处理完毕或者按下设定好的热键。rn线程A,C,D的代码都在Dll中。rnrn因为有错误,所以,我在创建线程A的时候就传递了一个整形实参的地址进去,并在线程C中不同的位置赋予此参数不同的值,以标识在何处发生错误。当线程B监视到线程A结束的时候就会把参数的值显示出来。(线程C发生错误时,会导致窗口关闭,也就是导致线程A结束)。rn测试的结果很令人郁闷,似乎发生错误的地方是绝对不可能发生错误的。rnrn一下是一些关键代码:rn[code=C/C++]rnrnvoid AutoPlay()rnrn //省略了一部分...rnrn *结束码=1;//结束码 记录的地址就是我传递进来的地址rnrn while(!需要停止)//需要停止是个BOOL类型的全局变量。一开始为0rn rn Sleep(1);rn rn *结束码=2;rnrn //省略.....rn rn if(QQGame_hwnd)rn rn *结束码=7;rnrn //省略.....rnrn *结束码=716;rn continue;rn rnrn *结束码=8;rnrn //省略....rn rn rnrnrn[/code]rnrnrn发生错误之后,线程B显示 结束码 的数值为 716。也就是说错误在 continue;或者 while(!需要停止) 这两个位置发生的?似乎这两个位置不可能出错呀!rnrn在循环中,并不是每次循环到716处就出错。只是有时。大概一两个小时碰上一次。rnrnrn
Could not open Hibernate Session for transaction
各位大侠:rn 小弟用的是服务器weblogic,数据库oracle。现在碰到的问题是如果20个用户并发就OK.但是如果50个服务器就会报错,报错信息如下:rn rn
Could not roll back Hibernate transaction.doc
Could not roll back Hibernate transaction.doc
Hibernate提示could not load an entity
系统是Win7,在本地Mysql数据库里测试没问题。但是,如果连接上远程Linux上的Mysql数据库,过一段时间就会出现问题,在插入一条记录时,提示下列信息。rnHTTP Status 500 -rnrntype Exception reportrnrnmessagernrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexceptionrnrnorg.<em>hibernate</em>.exception.JDBCConnectionException: <em>could</em> not load an entity: [entity.User#1]rn ……rnrnroot causernrncom.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failurernrnThe last packet successfully received from the server was 280,216 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago.rn sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn ……rnrn希望大家指点迷津……
Could not roll back Hibernate transaction
两个模块,一个用户添加,一个供应商添加rn用户和供应商都是用同一个类,就是一个字段区别,rn用户添加时没问题,供应商添加就老是报错,,,不仅仅save,update也报错,delete确没错。。。
Hibernate批处理操作优化 (批量插入、更新与删除)
问题描述 我开发的网站加了个新功能:需要在线上处理表数据的批量合并和更新,昨天下午发布上线,执行该功能后,服务器的load突然增高,变化曲线异常,SA教育了我一番,让我尽快处理,将CPU负载降低。 工作所需,我经常要写些程序批量处理数据,每次执行几十万数据处理的时候,我机子的CPU都会飙高,而且数据处理速度会越来越慢。比如第一个1W条要5分钟,第二个1W条就要10分钟,要干
Hibernate save()和insert()方法不能写入数据库的问题
session.save() getHibernateTemplate.save()   应用MyEclipse集成的Hibernate工具自动生成的代码,经常会遇到这种不写数据的问题.也就是当你执行一条增加或修改语句时,程序执行正常没有异常,查看sql语句确实执行了<em>insert</em>或update命令,可是当你查看数据库的时候会发现数据并没有同被增加或修改到数据库.   这种现象的原因是没有提交事务,因为MyEclipse自动生成的dao方法都没有提交的操作 <b
关于hibernate HQL不能使用insert语句
使用HQL语句来完成插入操作是不能实现的,不管你使用<em>insert</em> into....values...还是<em>insert</em> into.....select.....都不行 原因:因为Hibernate的HQL语言是用于面向对象实现查询功能的,然而在插入操作中是不会牵涉任何查询动作的,所以HQL不能用于<em>insert</em>语句的插入操作,而select、update、delete语句都可以有可能的查询实现,
HQL实现对表的insert操作
用过HQL(Hibernate查询语言14 章 HQL: Hibernate查询语言" href="http://www.redsaga.com/<em>hibernate</em>-ref/3.2/html/queryhql.html">)的同学,肯定知道这个坑爹的东西是没有“真正”的<em>insert</em>的,他的<em>insert</em>语法是这样的 <em>insert</em> into DelinquentAccount (id, name)
hibernatecould not resolve property
<em>hibernate</em> <em>could</em> not resolve propertyrn配置是正确的,偶尔才会出现这个错误,求解。。。。。。
Could not open Hibernate Session for transaction????
本人用的是环境是Spring+Hibernate+Struts,后台是SQL Server 2000.rn原来后台用的是Mysql,调试正常,后来想移植到SQL Server 2000中,仅把数据库连接相关配置文件修改了,但出错,提示:rn[color=#FF0000]其他异常:Could not open Hibernate Session for transaction; nested exception is org.<em>hibernate</em>.exception.GenericJDBCException: Cannot open connection [/color]rnrn配置文件主要内容如下:rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn AuctionUser.hbm.xmlrn Bid.hbm.xmlrn Item.hbm.xmlrn Kind.hbm.xmlrn State.hbm.xmlrn rn rn rn rn org.<em>hibernate</em>.dialect.SQLServerDialectrn truern updatern 20 rn true rn rn rn rnrn rn rn rnrnrn rn rn rn rn rn rn PROPAGATION_REQUIRED,readOnlyrn PROPAGATION_REQUIREDrn rn rn rnrnrn请多多指教!!
hibernate出错 could not execute query
在用struts+hiberante做一个list页面。里面有一个分页功能。首次加载没问题。rn当跳转到别的一个页面就会出现如下错:rn15:07:15,515 WARN JDBCExceptionReporter:71 - SQL Error: 0, SQLState: 07009rn15:07:15,546 ERROR JDBCExceptionReporter:72 - Invalid column name xxdm0_.rnorg.<em>hibernate</em>.exception.SQLGrammarException: <em>could</em> not execute queryrn at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:59)rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.<em>hibernate</em>.loader.Loader.doList(Loader.java:1596)rn at org.<em>hibernate</em>.loader.Loader.list(Loader.java:1577)rn at org.<em>hibernate</em>.loader.hql.QueryLoader.list(QueryLoader.java:395)rn at org.<em>hibernate</em>.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)rn at org.<em>hibernate</em>.impl.SessionImpl.list(SessionImpl.java:844)rn at org.<em>hibernate</em>.impl.QueryImpl.list(QueryImpl.java:74)rn at com.eyorker.util.DAOUtil.list(DAOUtil.java:54)rn at com.eyorker.edu.basic.SchoolAction.list(SchoolAction.java:62)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn-----------rn查询时候我是用了别名的。“select school from School as school”,但好像在打印出来的sql语句没有这个别名。而是用自动生成的别名。会不会是这样有问题???
Hibernate insert 效率
我借助Hibernate的 cascade机制往数据库插入新纪录,一次插入大概要2000来条记录,运行起来相当慢,请问有什么优化的方案吗?数据库是oracle 10g
Hibernate insert 错误
大家好!rnrn我使用了标准的SSH结构,在插入一个表时总是报错。rnrn程序如下:rnrn1. Admin.java (POJO)rn[code=Java]public class Admin rn private String adminCn;rn private String adminName;rn rnrn public Admin(String adminCn, String adminName) rn super();rn this.adminCn = adminCn;rn this.adminName = adminName;rn rnrn public Admin() rn rnrn public String getAdminCn() rn return adminCn;rn rnrn public void setAdminCn(String adminCn) rn this.adminCn = adminCn;rn rnrn public String getAdminName() rn return adminName;rn rnrn public void setAdminName(String adminName) rn this.adminName = adminName;rn rnrnrn[/code]rnrn2. hbm.xmlrn[code=XML]rnrnrn rn rn rn rn rn rn rn rn rn rn[/code]rnrn3.通过service到AdminDaoImpl.javarn[code=Java]public void <em>insert</em>(Admin admin)rn <em>insert</em>(admin);rn[/code]rnrn其中<em>insert</em>为继承的rn[code=Java]public Serializable <em>insert</em>(T entity) throws RuntimeException rn try rn return this.getHibernateTemplate().save(entity);rn catch (RuntimeException re) rn throw re;rn rn[/code]rnrnrn程序运行到<em>insert</em>时,抛错:rnrn[size=10px]2009-12-11 16:26:53 org.apache.struts.actions.DispatchAction dispatchMethodrn严重: Dispatch[/administration/adminAction] to method 'createAdmin' returned an exceptionrnjava.lang.reflect.InvocationTargetExceptionrn........rnrn[color=#FF00FF][b]Caused by: java.lang.StackOverflowError[/b][/color]rn at com.infineon.lls.daoimpl.AdminDaoImpl.<em>insert</em>(AdminDaoImpl.java:15)rn at com.infineon.lls.daoimpl.AdminDaoImpl.<em>insert</em>(AdminDaoImpl.java:15)rn at com.infineon.lls.daoimpl.AdminDaoImpl.<em>insert</em>(AdminDaoImpl.java:15)rn at com.infineon.lls.daoimpl.AdminDaoImpl.<em>insert</em>(AdminDaoImpl.java:15)rn at com.infineon.lls.daoimpl.AdminDaoImpl.<em>insert</em>(AdminDaoImpl.java:15)rn at com.infineon.lls.daoimpl.AdminDaoImpl.<em>insert</em>(AdminDaoImpl.java:15)rn at com.infineon.lls.daoimpl.AdminDaoImpl.<em>insert</em>(AdminDaoImpl.java:15)rn at com.infineon.lls.daoimpl.AdminDaoImpl.<em>insert</em>(AdminDaoImpl.java:15)[/size]rn这个错误大概有上百条。rnrn不知道是什么原因,还请大家帮忙。rn
struts-2.3.16.1-all.zip下载
完整的struts2框架开发包。这个需要配置到你们的电脑上,然后用myeclipse来调用这些包。 相关下载链接:[url=//download.csdn.net/download/hypnos_ff/7026927?utm_source=bbsseo]//download.csdn.net/download/hypnos_ff/7026927?utm_source=bbsseo[/url]
惠普刀片解决方案 成功案例下载
惠普刀片解决方案 惠普刀片 解决方案 优势 特点,产品改用、成功案例 相关下载链接:[url=//download.csdn.net/download/kinghuangworld/2093417?utm_source=bbsseo]//download.csdn.net/download/kinghuangworld/2093417?utm_source=bbsseo[/url]
blackberry xml文件解析下载
该代码主要讲述了blackberry如何进行xml文件解析的一些方法及实例。 相关下载链接:[url=//download.csdn.net/download/yanghaiying0422/3824994?utm_source=bbsseo]//download.csdn.net/download/yanghaiying0422/3824994?utm_source=bbsseo[/url]
相关热词 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天 c#字典序排序 c# 截屏取色 c#中的哪些属于托管机制
我们是很有底线的