hibernate 插入数据时报 could not insert 高手进 [问题点数:150分,结帖人every888]

Bbs2
本版专家分:392
结帖率 98.02%
Bbs2
本版专家分:392
Bbs3
本版专家分:755
Bbs2
本版专家分:392
Bbs2
本版专家分:392
Bbs5
本版专家分:3127
Bbs6
本版专家分:6643
Bbs2
本版专家分:392
Bbs4
本版专家分:1160
Bbs2
本版专家分:305
Bbs2
本版专家分:392
Bbs4
本版专家分:1094
Bbs2
本版专家分:392
Bbs7
本版专家分:13605
Blank
蓝花 2009年1月 Java大版内专家分月排行榜第三
Bbs2
本版专家分:392
Bbs2
本版专家分:392
Bbs2
本版专家分:357
Bbs2
本版专家分:179
Bbs1
本版专家分:17
Bbs2
本版专家分:392
Bbs7
本版专家分:13605
Blank
蓝花 2009年1月 Java大版内专家分月排行榜第三
Bbs1
本版专家分:2
Bbs2
本版专家分:256
Bbs1
本版专家分:4
Bbs1
本版专家分:0
hibernate问题(高手进)
[code=Java]package myFamily;rnrnimport org.<em>hibernate</em>.cfg.Configuration;rnimport org.<em>hibernate</em>.tool.hbm2ddl.SchemaExport;rn rnpublic class Explorer rn rn public static void main(String[] args) rn rn Configuration cf=new Configuration().configure();rn SchemaExport se=new SchemaExport(cf);rn se.create(true, true);rn rn [/code]rnrn执行这段代码时,报这个错:rnException in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinderrnrn我所有的jar都引入了,rnStaticLoggerBinder这个类的定义在哪里啊???rnrnrn引入的jar包如下,是有遗漏吗 ?rnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\<em>hibernate</em>-search-3.2.0.Beta1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\xml-apis-1.0.b2.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\activation-1.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\antlr-2.7.6.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\asm-3.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\cglib-2.2.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\commons-codec-1.3.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\commons-collections-3.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\commons-io-1.3.2.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\dom4j-1.6.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\geronimo-stax-api_1.0_spec-1.0.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\<em>hibernate</em>-annotations-3.5.0-Beta-2.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\<em>hibernate</em>-commons-annotations-3.2.0.Beta1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\<em>hibernate</em>-core-3.5.0-Beta-2.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\<em>hibernate</em>-entitymanager-3.5.0-Beta-2.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\hsqldb-1.8.0.2.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\javassist-3.9.0.GA.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\jaxb-api-2.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\jaxb-impl-2.1.3.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\jgroups-2.6.7.GA.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\jpa-api-2.0-cr-1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\jsr250-api-1.0.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\jta-1.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\lucene-analyzers-2.4.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\lucene-core-2.4.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\lucene-snowball-2.4.1.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\slf4j-api-1.5.8.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\solr-common-1.3.0.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\solr-commons-csv-1.3.0.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\solr-core-1.3.0.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\solr-lucene-analyzers-1.3.0.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\solr-lucene-highlighter-1.3.0.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\solr-lucene-queries-1.3.0.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\solr-lucene-snowball-1.3.0.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\solr-lucene-spellchecker-1.3.0.jarrnF:\<em>hibernate</em>-search-3.2.0.Be1-dist\<em>hibernate</em>-search-3.2.0.Beta1\dist\lib\stax-api-1.0-2.jar
Hibernate问题!高手
提示错误:package net.sf.<em>hibernate</em> does not existrn错误行:import net.sf.<em>hibernate</em>.*;rnrn我web站点下的WEB-INF/lib目录下已经放了<em>hibernate</em>2.jar文件rnrn为何出错??
高手进,关于hibernate
public void testAA2()rn HibernateUtil.beginTransaction();rn Session session=HibernateUtil.getCurrentSession();rn ClassRoom room=(ClassRoom)session.load(ClassRoom.class,new Integer(1));rn Set set=room.getSet();rn ClassRoom room1=new ClassRoom();rn room1.setName("0002");rn room1.setSet(set);rn Iterator iter=set.iterator();rn while(iter.hasNext())rn Student student=(Student)iter.next(); rn student.setRoomid(room1);rn rn session.save(room1);rn session.getTransaction().commit();rn session.close();rn rn这段程序出错了,怎么回事呀rnorg.<em>hibernate</em>.HibernateException: Found shared references to a collection: org.ldsj.pojo.ClassRoom.setrn at org.<em>hibernate</em>.engine.Collections.processReachableCollection(Collections.java:163)rn at org.<em>hibernate</em>.event.def.FlushVisitor.processCollection(FlushVisitor.java:37)rn at org.<em>hibernate</em>.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101)rn at org.<em>hibernate</em>.event.def.AbstractVisitor.processValue(AbstractVisitor.java:61)rn at org.<em>hibernate</em>.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55)rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:124)rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)rn at org.<em>hibernate</em>.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)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.ldsj.test.Test2.testAA2(Test2.java:58)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 org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnrn
Hibernate高手速度进....
我的Person类中有个Address类的属性,如何写<em>hibernate</em>的HQL语句,要求HQL语句返回所有的Person对象,并且rnrnPerson对象里面的Address属性必须有内容。该如何做呢?(Person和Address都有对应的数据表,Person表中有rnrnAddress的主键,Person和Address是多对一的关系。)rnrn HQL="from Person p inner join p.address" 我在<em>hibernate</em>Template.find(HQL)中是这样写的,可以么?
Hibernate高手进!
在程序启动后,得到连接数据库的用户名和密码. rnrn如何根据此用户名和密码获得数据库连接rnrn使用proxool.xml连接池rn
(高手进)hibernate的使用
db用mysql,其不支持存储过程,学了<em>hibernate</em>之后,可以不用顾及存储过程吗?rn<em>hibernate</em>可以发挥哪些mysql做不到的事呢?谢谢啦!
插入数据时报的错误
org.<em>hibernate</em>.exception.GenericJDBCException: <em>could</em> not <em>insert</em>: [com.yanfa.entity.AuthEntity]rn at org.<em>hibernate</em>.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)rn at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:128)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:2345)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.<em>insert</em>(AbstractEntityPersister.java:2852)rn at org.<em>hibernate</em>.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)rn at org.<em>hibernate</em>.engine.ActionQueue.execute(ActionQueue.java:273)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)rn at org.<em>hibernate</em>.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)rn at org.<em>hibernate</em>.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)rn at org.<em>hibernate</em>.impl.SessionImpl.saveOrUpdate(SessionImpl.java:673)rn at com.yanfa.modules.orm.<em>hibernate</em>.SimpleHibernateDao.save(SimpleHibernateDao.java:81)rn at com.yanfa.service.impl.AuthServiceImpl.save(AuthServiceImpl.java:64)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:597)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)rn at $Proxy38.save(Unknown Source)rn at com.yanfa.web.controller.manager.CompanyController.addcompany(CompanyController.java:212)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:597)rn at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)rn at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)rn at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:157)rn at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:131)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)rn at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:99)rn at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)rnrn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)rn at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)rnrn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rnrn at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:119)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.captcha.JcaptchaAuthenticationFilter.doFilter(JcaptchaAuthenticationFilter.java:98)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)rn at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)rn at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)rn at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowedrn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)rnrn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)rn at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2322)rn at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2289)rn at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2274)rn at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:203)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 ... 99 morernrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrn
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:
[b]错误信息:[/b]rnrn[color=#FF0000]15:34:09,937 INFO org.<em>hibernate</em>.tool.hbm2ddl.SchemaUpdate:155 - Running hbm2ddl schema updatern15:34:09,938 INFO org.<em>hibernate</em>.tool.hbm2ddl.SchemaUpdate:167 - fetching database metadatarn15:34:09,940 INFO org.<em>hibernate</em>.tool.hbm2ddl.SchemaUpdate:179 - updating schemarn15:34:09,944 INFO org.<em>hibernate</em>.tool.hbm2ddl.DatabaseMetadata:119 - table not found: loginandregister_sshrn15:34:09,944 INFO org.<em>hibernate</em>.tool.hbm2ddl.DatabaseMetadata:119 - table not found: loginandregister_sshrn15:34:09,945 DEBUG org.<em>hibernate</em>.tool.hbm2ddl.SchemaUpdate:203 - create table loginandregister_ssh (id integer not null auto_increment, password varchar(255), username varchar(255), primary key (id))rn15:34:09,945 ERROR org.<em>hibernate</em>.tool.hbm2ddl.SchemaUpdate:212 - Unsuccessful: create table loginandregister_ssh (id integer not null auto_increment, password varchar(255), username varchar(255), primary key (id))rn15:34:09,945 ERROR org.<em>hibernate</em>.tool.hbm2ddl.SchemaUpdate:213 - No database selectedrn15:34:09,946 INFO org.<em>hibernate</em>.tool.hbm2ddl.SchemaUpdate:217 - schema update completernHibernate: rn <em>insert</em> rn intorn loginandregister_sshrn (password, username) rn valuesrn (?, ?)rn15:34:10,036 WARN org.<em>hibernate</em>.util.JDBCExceptionReporter:100 - SQL Error: 1046, SQLState: 3D000rn15:34:10,037 ERROR org.<em>hibernate</em>.util.JDBCExceptionReporter:101 - No database selectedrnException in thread "main" org.<em>hibernate</em>.exception.GenericJDBCException: <em>could</em> not <em>insert</em>: [com.dqgb.Entity.User]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 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:342)rn at $Proxy7.save(Unknown Source)rn at com.dqgb.test.test.main(test.java:27)rnCaused by: java.sql.SQLException: No database selectedrn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)rn at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570)rn at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731)rn at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815)rn at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)rn at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)rn at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)rn at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)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 ... 22 more[/color]rnrn[b]<em>hibernate</em>.cfg.xml[/b]rnrn[color=#FF0000]rnrnrnrnrn rnrn com.mysql.jdbc.Driverrn jdbc:mysql://localhost:3306/rn rootrn rootrn org.<em>hibernate</em>.dialect.MySQLDialectrnrn rn 1rnrn rn threadrnrn rn org.<em>hibernate</em>.cache.NoCacheProviderrnrn rn truern truernrn rn updaternrn rn rnrn[/color]rnrn[b]Entity类[/b]rnrn[color=#FF0000]package com.dqgb.Entity;rnrnimport javax.persistence.Entity;rnimport javax.persistence.GeneratedValue;rnimport javax.persistence.GenerationType;rnimport javax.persistence.Id;rnimport javax.persistence.Table;rnrn@Entityrn@Table(name="loginandregister_ssh")rnpublic class User rn private int id;rn private String username;rn private String password;rn @Idrn @GeneratedValue(strategy=GenerationType.IDENTITY)rn public int getId() rn return id;rn rn public void setId(int id) rn this.id = id;rn rn rn public String getUsername() rn return username;rn rn public void setUsername(String username) rn this.username = username;rn rn rn public String getPassword() rn return password;rn rn public void setPassword(String password) rn this.password = password;rn rn[/color]rnrn[b]DAO[/b]rnrn[color=#FF0000]package com.dqgb.test;rnrnimport org.<em>hibernate</em>.Session;rnimport org.<em>hibernate</em>.SessionFactory;rnimport org.<em>hibernate</em>.cfg.AnnotationConfiguration;rnimport org.<em>hibernate</em>.cfg.Configuration;rnrnimport com.dqgb.Entity.User;rnrnpublic class test rnrn public static void main(String[] args) rn rn User user = new User();rn rn user.setUsername("1111"); rn user.setPassword("1111");rn rn Configuration cfg = new AnnotationConfiguration();rn SessionFactory sf = cfg.configure().buildSessionFactory();rn Session session = sf.getCurrentSession();rn session.beginTransaction();rn session.save(user);rn session.getTransaction().commit();rn session.close();rn sf.close(); rn rnrn[/color]rnrnrn
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
求助: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)
hibernate 插入数据
简单的用<em>hibernate</em>中的save()方法向表中插入一条数据,数据4个字段,其中id为自增长,workname字段是我从表单获取过来的内容,其他两个str1,str2库中设置可为空,所以暂时不添加,这个save()方法我怎么用都写不对,尤其Id这里,我写上setId()就报错:不能添加显性数据什么的,不写的话又提示null字段错误,很郁闷,原来做的都是读取今天做个添加怎么都写不出来,帮帮忙大家:rnaction代码:rn[code=Java]rnpublic class Addwork extends Action rn public ActionForward execute (ActionMapping mapping,ActionForm form,rn HttpServletRequest request,HttpServletResponse response)rn rn tryrn request.setCharacterEncoding("gb2312");rn String workname = request.getParameter("workname");rn rn if(!workname.equals("") && !workname.isEmpty())rn rn List temp = new WorkNameDAO().findbyname(workname);rn if(temp.size()>=1)rn rn return mapping.findForward("err");rn rn elsern rn rn /*SaveForm saveForm = (SaveForm) form;rn Transaction tx=WorkNameDAO.getSessionFactory().openSession().beginTransaction(); rn WorkName article=new WorkName();rn article.setTitle(saveForm.getTitle());rn article.setContent(saveForm.getContext());rn WorkNameDAO.save(article);rn tx.commit();rn return mapping.findForward("success");*/rnrn rn rn rn HibernateSessionFactory.getSessionFactory().openSession();rn WorkName wkname = new WorkName();rn wkname.setWorkname(workname);rn wkname.setBewrite("");rn wkname.setWkprincipal("");rn WorkNameDAO um = new WorkNameDAO();rn um.save(wkname);rn HibernateSessionFactory.getSessionFactory().close();rn return mapping.findForward("addsecc"); rn rn rn elsern return mapping.findForward("err");rn rn catch(UnsupportedEncodingException e)rn return mapping.findForward("logonerr");rn rn rn[/code]rnMyEclipse自动生成的DAO文件代码:rn[code=Java]public void save(WorkName transientInstance) rn log.debug("saving WorkName instance");rn try rn getSession().save(transientInstance);rn log.debug("save successful");rn catch (RuntimeException re) rn log.error("save failed", re);rn throw re;rn rn [/code]
Hibernate插入数据
上传的资料都是非常经典的,这也是我学习过程中的心得,希望大家能给我指点,也希望大家多上传资料共同学习。千万不要传空文件夹。。。
hibernate插入数据
我有两个表:rnUser(int userid;String username)rnInex(int inexid;String inexname;int userid)rnInex表字段userid是User表的外键rn我用<em>hibernate</em>生成的POJO里面,Inex内却没有userid字段,只有一个User类型的userrn我现在要插入记录,请问,怎么给这个POJO赋值啊;rn难道要:rnpublic void addInexDAO(InexForm inexForm,ine userid)rnInex inex=new Inex();rnUser user=new User();rnuser.setUserid(userid);rninex.setInexname(inexForm.getInexname());rninex.setUser(user);rnsave(inex);rnrn难道这样,不会吧!!请大家教教我》》
关于insert插入数据的问题
很抱歉,很久没有做数据库程序了,rn以前知道<em>insert</em>是在当前记录下插入一条新的记录,append是在记录末尾追加一条记录rn现在想在某条满足条件的记录后面插入一条记录rn dm.T_tongyong.MoveBy(10);rn Table1.Insert;rn Table1.FieldByName('ziduan1').AsDateTime :='1';rn Table1.FieldByName('字段2').AsInteger :='2';rn Table1.Post;rn执行上述语句后为何始终在数据集的末尾追加一条记录,而不是在当前记录(第10条记录后)下追加?
insert into 插入数据不完整?
数据库是sql server 2000rndm.querytem.Close;rndm.querytem.commandtext:='<em>insert</em> into abc(khm,numa) values(:a,:b)';rndm.querytem.Params.ParamByName('a').value:='这里是需要插入字段中的字符串'; dm.querytem.Params.ParamByName('b').value:='这里也是插入';rndm.querytem.Execute;rn问题是:字段khm(varchar.30)只显示前6个汉字即:"这里是需要插",其余的如"入字段中的字符串"这几个字符总是插不进去.
mysql在插入数据时报错误1366
【问题】: 在使用sqlyog工具的过程中,mysql<em>插入数据</em><em>时报</em>错误1366,如图: 【问题原因】: 中文编码问题 【解决方法】: 1、先查看当前表格的编码:SHOW FULL COLUMNS FROM表名 2、修改编码:ALTER TABLE 表格名 CONVERT TO CHARACTER SET gbk COLLATE gbk_chinese_ci ...
hibernate高手进,憋了好几天了
org.<em>hibernate</em>.PropertyAccessException: IllegalArgumentException occurred calling getter of com.entity.insideEmail.receiveAnnex.TbInsideReceiveEmailAnnex.annexIdrn at org.<em>hibernate</em>.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171)rn at org.<em>hibernate</em>.tuple.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:176)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3257)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:2983)rn at org.<em>hibernate</em>.engine.ForeignKeys.isTransient(ForeignKeys.java:181)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:460)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:84)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)rn at org.<em>hibernate</em>.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:502)rn at org.<em>hibernate</em>.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)rn at org.<em>hibernate</em>.engine.CascadingAction$1.cascade(CascadingAction.java:134)rn at org.<em>hibernate</em>.engine.Cascade.cascadeToOne(Cascade.java:213)rn at org.<em>hibernate</em>.engine.Cascade.cascadeAssociation(Cascade.java:157)rn at org.<em>hibernate</em>.engine.Cascade.cascadeProperty(Cascade.java:108)rn at org.<em>hibernate</em>.engine.Cascade.cascadeCollectionElements(Cascade.java:290)rn at org.<em>hibernate</em>.engine.Cascade.cascadeCollection(Cascade.java:185)rn at org.<em>hibernate</em>.engine.Cascade.cascadeAssociation(Cascade.java:160)rn at org.<em>hibernate</em>.engine.Cascade.cascadeProperty(Cascade.java:108)rn at org.<em>hibernate</em>.engine.Cascade.cascade(Cascade.java:248)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:410)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:299)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:114)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:530)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:518)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:514)rn at com.DAO.InsideEmailDAOImp.sendEmail(InsideEmailDAOImp.java:77)rn at com.DAO.InsideEmailDAOImp.main(InsideEmailDAOImp.java:204)rnCaused by: java.lang.IllegalArgumentException: object is not an instance of declaring classrn 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>.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)rn ... 32 more
大批量插入数据(sql insert
这是今天做测试的时候需要批量<em>insert</em>到一张表中20万条数据时使用到的测试脚本,记录一下: declare @i varchar(max) --声明一个变量作为循环条件-- set @i=1 while @i1000001 --执行100000次 <em>insert</em>-- begin <em>insert</em> INTO 表名(id,name,time) values('12345678'+@i,'小明','1
插入数据问题(INSERT )!
VC中创建数据库<em>插入数据</em>:rndbsql.Format("INSERT INTO Exp(ID, Np, Pft, Pfpi)VALUES(%ld,%6.1f,%5.3f,%5.3f)",dbcount,transdata[0],transdata[1],transdata[2],transdata[3],transdata[4]);rnrn我要在表的后面插入:rn H:M:S.MS ,也就是15:26:41.341 (小时:分:秒.毫秒)怎么插入?rn 问题主要是:VALUES()中的参数怎么添加,比如:,%5.3f指的是浮点数,有效位5位,小数位3位。rn 那表示成:小时:分钟:秒.毫秒 的格式怎么写?rnrn谢谢!rn
Mybatis使用insert插入数据
mybatis使用<em>insert</em>方法插入mysql数据库,正常执行,在数据库中却没有显示
Oracle 批量insert 插入数据
一、插入的语法 INSERT INTO SC_PROP ( A, B, C ) ( select '1','2','3' from dual where 1=1 );
ODBC INSERT插入数据
怎么向多个表中<em>插入数据</em>。。比如有五六个表,类似student,course,speciality,teacher这些表。rn一条一条插入很麻烦吧,应该有更好的方法。但我只会用一条一条插入rnSQLCHAR sqlInsertDe1[100] = "<em>insert</em> department(dno,dept_name) values('d01', '软件学院')";rn SQLCHAR sqlInsertDe2[100] = "<em>insert</em> department(dno,dept_name) values('d02', '计算机学院')";rnrn SQLCHAR sqlInsertSpe1[100] = "<em>insert</em> speciality values('s01', 'd01', '软件工程')";rn SQLCHAR sqlInsertSpe2[100] = "<em>insert</em> speciality values('s02', 'd02', '计算机科学')";rnrn SQLCHAR sqlInsertTe1[100] = "<em>insert</em> teacher(t_no, t_name, dno) values('t01', 'Tang', 'd01') ";rn SQLCHAR sqlInsertTe2[100] = "<em>insert</em> teacher(t_no,t_name,dno) values('t02', 'chen', 'd01')";rnrn SQLCHAR sqlInsertStu1[100] = "<em>insert</em> student values('20130001', 'Tom', '男', '19940101', 'd01', 's01', 'rg1')";rn SQLCHAR sqlInsertStu2[100] = "<em>insert</em> student values('20130002', 'Jane', '女', '19940201', 'd01', 's01', 'rg1')";rnrn SQLCHAR sqlInsertCou1[80] = "<em>insert</em> course(cno,cname,spno) values('c1', '数据库', 's01')";rn SQLCHAR sqlInsertCou2[80] = "<em>insert</em> course(cno,cname,spno) values('c2', '数据结构', 's02')";rnrn SQLCHAR sqlInsertSt_Cou1[100] = "<em>insert</em> student_course values('20130001', 1, 85)";rn SQLCHAR sqlInsertSt_Cou2[100] = "<em>insert</em> student_course values('20130002', 2, 78)";rnrnrnresult = SQLPrepare(hStmt, sqlInsertDe1, SQL_NTS);rnrn if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO))rn rn SQLFreeHandle(SQL_HANDLE_STMT, hStmt);rn SQLFreeHandle(SQL_HANDLE_DBC, hDbc);rn SQLFreeHandle(SQL_HANDLE_ENV, hEnv);rn printf("绑定失败!");rn getchar();rn exit(0);rn rn // 执行SQL语句rn result = SQLExecute(hStmt);rn if (result == SQL_ERROR)rn rn SQLFreeHandle(SQL_HANDLE_STMT, hStmt);rn SQLFreeHandle(SQL_HANDLE_DBC, hDbc);rn SQLFreeHandle(SQL_HANDLE_ENV, hEnv);rn printf("执行sql失败!");rn getchar();rn exit(0);rn rn // 执行完sql语句之后,要读取数据rn /*rn while ((result = SQLFetch(hStmt)) != SQL_NO_DATA)rn cout << szName << endl;rn */rn // 释放句柄和断开连接rn SQLFreeHandle(SQL_HANDLE_STMT, hStmt);rn SQLDisconnect(hDbc);rn SQLFreeHandle(SQL_HANDLE_DBC, hDbc);rn SQLFreeHandle(SQL_HANDLE_ENV, hEnv);rnrnrn只会这么用。前面的那些环境,句柄都设置好了rn
插入数据失败问题!(insert)
我用<em>insert</em>往数据库<em>插入数据</em>,数据库字段设为ntext类型,但当我插入的数据大于一定量的时候会插入不成功! 是不是ntext字段不能存储大于一定量的数据!
通过Insert IGNORE插入数据
n MySQL是一个关系型数据库管理系统,目前属于Oracle旗下产品。MySQL是最流行的关系型数据库管理系统之一。nnn nn nnn MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。MySQL采用了双授权策略,分为社区版和商业版,由于其体积小、速度快、总体拥有成本低,尤其是开放源代码这一特点。nnn nn nnn nnn 本课程作为MySQL的基础课程,主要讲解以下内容:nnn nn 1.     MySQL 中的数据修改nnn 2.     MySQL的事务nnn 3.     MySQL数据库和表的管理nnn 4.     MySQL的数据类型nnn 5.     MySQL的约束nnn nnn n
insert插入数据工具
很好用的<em>插入数据</em>的代码,自己写的话,很麻烦,所以大家可以下载来使用!
还是hibernate问题(高手进)
这样的代码:rn[code=Java]package myFamily;rnrnrnimport org.<em>hibernate</em>.Session;rnimport org.<em>hibernate</em>.SessionFactory;rnimport org.<em>hibernate</em>.Transaction;rnimport org.<em>hibernate</em>.cfg.Configuration;rn rnpublic class Explorer rn rn public static void main(String[] args) rnrn Configuration conf=new Configuration().configure();rn SessionFactory sf=conf.buildSessionFactory();rn Session se=null;rn User u=new User();rn u.setName("xuxiao");rn tryrn se=sf.openSession();rn se.beginTransaction();rn se.getTransaction().begin();rn se.save(u);rn se.getTransaction().commit();rn catch(Exception e)rn e.printStackTrace();rn finallyrn se.close();rn rn rn rn [/code]rnrnrnrn报这样的错:rnException in thread "main" java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.supportsGetGeneratedKeys()Zrn at org.<em>hibernate</em>.cfg.SettingsFactory.buildSettings(SettingsFactory.java:123)rn at org.<em>hibernate</em>.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)rn at org.<em>hibernate</em>.cfg.Configuration.buildSettings(Configuration.java:2115)rn at org.<em>hibernate</em>.cfg.Configuration.buildSessionFactory(Configuration.java:1339)rn at myFamily.Explorer.main(Explorer.java:14)rnrnrn
存储过程insert不能插入数据
SET QUOTED_IDENTIFIER OFF rnGOrnSET ANSI_NULLS OFF rnGOrnrnrnrnrnrnALTER PROCEDURE [setFlagx]rn(rn@sscode varchar(10),rn@ssdate varchar(20),rn@o float,rn@c float,rn@h float,rn@l float,rn@vol int,rn@amount float,rn@ssFlag varchar(1)rn)rnASrndeclare @dataOr tinyintrnselect @dataOr=数据有否 from 数据完成指示 where 代码=@sscode and 日期=@ssdate rn--BEGIN TRAN AddOrder rnif @dataOr=1 --㩳取数据不存在,返回rnUPDATE [数据完成指示]rn SET [代码] = @sscode,rn [日期] = @ssdate,rn [开盘] = @o,rn [收盘] = @c,rn [最高] = @h,rn [最低] = @l,rn [成交量] = @vol,rn [成交额] = @amount rnWHERE rn ( [代码] = @sscode ANDrn [日期] = @ssdate ANDrn [数据有否]= 1)rnelse if @dataor=null rnINSERT INTO [数据完成指示] ( [代码], [日期], [数据有否], [开盘], [收盘], [最高], [最低], [成交量], [成交额]) rnVALUES ( @sscode, convert(datetime,@ssdate), convert(tinyint,@ssflag), @o, @c, @h, @l, @vol, @amount)rnif @@trancount>0 rncommit tran rn--BEGIN TRAN AddOrder rnrnrnrnGOrnSET QUOTED_IDENTIFIER OFF rnGOrnSET ANSI_NULLS ON rnGOrnrn 俺没弄过存储过程,也不想涉及太深,应付一下就行。大家见笑了rnselect @dataOr=数据有否 from 数据完成指示 where 代码=@sscode and 日期=@ssdate rn执行完这句后,@@trancount=1rnrn我就乱加了一句 if @@trancount>0 rncommit tran rnrn<em>insert</em>就可以<em>插入数据</em>,没有就不行,我想知道为什么,请朋友给说一说,谢谢。rn
insert插入数据问题
请问专家,执行INSERT语句向一个表导入数据出现"插入错误: 列名或所提供值的数目与表定义不匹配"是什么原因啊?
multimap insert 插入数据失败
typedef multimap mmtype;rn mmtype D;rn D.<em>insert</em>(mmtype::value_type("1111",1111));rnrn代码完全是照着教材写的,但是编译报错:rnrn正在编译...rnstlTestView.cpprnf:\program files\microsoft visual studio 9.0\vc\include\functional(143) : error C2784: “bool std::operator &,const std::_Tree &)”: 无法从“重载函数类型”为“const std::_Tree &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xtree(1466) : 参见“std::operator ::operator ()(const _Ty &,const _Ty &) const”时rn withrn [rn _Ty=std::stringrn ]rn f:\program files\microsoft visual studio 9.0\vc\include\map(68): 参见对正在编译的类 模板 实例化“std::less”的引用rn withrn [rn _Ty=std::stringrn ]rn f:\program files\microsoft visual studio 9.0\vc\include\xtree(22): 参见对正在编译的类 模板 实例化“std::_Tmap_traits”的引用rn withrn [rn _Kty=std::string,rn _Ty=long,rn _Pr=std::less,rn _Alloc=std::allocator>,rn _Mfl=truern ]rn f:\program files\microsoft visual studio 9.0\vc\include\xtree(63): 参见对正在编译的类 模板 实例化“std::_Tree_nod”的引用rn withrn [rn _Traits=std::_Tmap_traits,std::allocator>,true>rn ]rn f:\program files\microsoft visual studio 9.0\vc\include\xtree(89): 参见对正在编译的类 模板 实例化“std::_Tree_ptr”的引用rn withrn [rn _Traits=std::_Tmap_traits,std::allocator>,true>rn ]rn f:\program files\microsoft visual studio 9.0\vc\include\xtree(107): 参见对正在编译的类 模板 实例化“std::_Tree_val”的引用rn withrn [rn _Traits=std::_Tmap_traits,std::allocator>,true>rn ]rn f:\program files\microsoft visual studio 9.0\vc\include\map(203): 参见对正在编译的类 模板 实例化“std::_Tree”的引用rn withrn [rn _Traits=std::_Tmap_traits,std::allocator>,true>rn ]rn e:\sorftwork\stltest\stltest\stltestview.cpp(146): 参见对正在编译的类 模板 实例化“std::multimap”的引用rn withrn [rn _Kty=std::string,rn _Ty=longrn ]rnf:\program files\microsoft visual studio 9.0\vc\include\functional(143) : error C2784: “bool std::operator &,const std::_Tree &)”: 无法从“重载函数类型”为“const std::_Tree &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xtree(1466) : 参见“std::operator &,const std::_Tree &)”: 无法从“重载函数类型”为“const std::_Tree &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xtree(1466) : 参见“std::operator &,const std::_Tree &)”: 无法从“重载函数类型”为“const std::_Tree &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xtree(1466) : 参见“std::operator &,const std::vector &)”: 无法从“重载函数类型”为“const std::vector &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\vector(1322) : 参见“std::operator &,const std::vector &)”: 无法从“重载函数类型”为“const std::vector &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\vector(1322) : 参见“std::operator &,const std::vector &)”: 无法从“重载函数类型”为“const std::vector &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\vector(1322) : 参见“std::operator &,const std::vector &)”: 无法从“重载函数类型”为“const std::vector &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\vector(1322) : 参见“std::operator &,const std::reverse_iterator &)”: 无法从“重载函数类型”为“const std::reverse_iterator &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xutility(2262) : 参见“std::operator &,const std::reverse_iterator &)”: 无法从“重载函数类型”为“const std::reverse_iterator &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xutility(2262) : 参见“std::operator &,const std::reverse_iterator &)”: 无法从“重载函数类型”为“const std::reverse_iterator &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xutility(2262) : 参见“std::operator &,const std::reverse_iterator &)”: 无法从“重载函数类型”为“const std::reverse_iterator &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xutility(2262) : 参见“std::operator &,const std::_Revranit &)”: 无法从“重载函数类型”为“const std::_Revranit &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xutility(2072) : 参见“std::operator &,const std::_Revranit &)”: 无法从“重载函数类型”为“const std::_Revranit &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xutility(2072) : 参见“std::operator &,const std::_Revranit &)”: 无法从“重载函数类型”为“const std::_Revranit &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xutility(2072) : 参见“std::operator &,const std::_Revranit &)”: 无法从“重载函数类型”为“const std::_Revranit &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\xutility(2072) : 参见“std::operator &,const std::pair &)”: 无法从“重载函数类型”为“const std::pair &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\utility(99) : 参见“std::operator &,const std::pair &)”: 无法从“重载函数类型”为“const std::pair &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\utility(99) : 参见“std::operator &,const std::pair &)”: 无法从“重载函数类型”为“const std::pair &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\utility(99) : 参见“std::operator &,const std::pair &)”: 无法从“重载函数类型”为“const std::pair &”推导 参数rn f:\program files\microsoft visual studio 9.0\vc\include\utility(99) : 参见“std::operator <”: “const std::string”不定义该运算符或到预定义运算符可接收的类型的转换rn生成日志保存在“file://e:\sorftWork\stlTest\stlTest\Debug\BuildLog.htm”rnstlTest - 21 个错误,0 个警告rn========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
SQL语句插入数据insert
本系列视频从MySQL数据库基础到应用为大家全面讲述了MySQL数据库的安装、管理工具、字符集、数据库操作、运算符、函数、视图、触发器等相关日常操作使用!
mysql之插入数据insert(4)
1.语法 INSERT INTO table(column1,column2...) VALUES (value1,value2,...); 语法释义 - 在INSERT INTO之 后跟表名,括号内跟字段,逗号分隔; - 在VALUES 跟值;2. 举个例子INSERT INTO tasks(subject,start_date,end_date,description) VALU
关于Insert插入数据问题
private void Button1_Click(object sender, System.EventArgs e)rn rnSqlConnection myConn=new SqlConnection("Data Source=(local);database=Northwind;uid=sa;pwd=cyx7688&*");rn myConn.Open();rn String strSQL="Select * from Meeting";rn SqlCommand cmd=new SqlCommand(strSQL,myConn);rn SqlDataReader dr=cmd.ExecuteReader();rn DataGrid1.DataSource=dr;rn DataGrid1.DataBind();rn myConn.Close();rn dr.Close();rnrn上面的语句为增加数据到数据库,但是我每刷新一次页面,数据就增加一次,也就是说我没有按Button按钮,只要刷新,就增加了数据,这不是我想要的,我要的是当我按Button是才增加数据!怎么改?是不是用IsPostBack?加到哪个地方?
insert 插入数据小问题,急
现在有表1和表2rn表1和表2中的字段都是 姓名,学号,成绩,和关联这4个字段rnrn我现在想利用<em>insert</em> 语句把表1中所有关联=1 的数据全部插入到表2中,大家告诉我应该怎么写这段代码啊!rnrn十分感谢! 在线等待,答对给分!
插入数据insert into的问题
您已经成功注册成我们的会员!";rn?>rnrn这个输出的结果是:您已经成功注册成我们的会员!rnrn可是用PHPMYADMIN打开数据库时 却没有这个记录 这个到底是什么问题呢
用INSERT插入数据
<em>insert</em> into Student values('03' , N'孙风' , '1990-05-20' , N'男')rn其中的N是啥意思
第四章 第一节:插入数据INSERT
<em>插入数据</em>:INSERT INSERT [INTO] table_name (列1, 列2,...) VALUES (值1, 值2,....),()....; 创建一个表users,有一下属性: mysql> CREATE TABLE users(     -> int SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,     -> usernam
sql批量Insert插入数据
大批量数据向表中插入 插入到  BusinessCategory表中   主键Id    字段  ProudctCategroyID  ,VendorID <em>insert</em> into BusinessCategory(ProudctCategroyID,VendorID)  (select id,289 from ProudctCategroy  ) 中间省略values 关键字     
17.基础-插入数据(INSERT)
数据插入       INSERT是用来插入(添加)行到数据库表的,有以下几种情况:       1.插入完整的行;       2.插入行的一部分;       3.插入多行;       4.插入某些查询的结果;       插入及系统安全 :可针对每个表或每个用户,利用MySQL的安全机制禁止使用INSERT语句;插入完整的行输入:INSERT INTO Customers     //指定...
数据库学习 - insert into(插入数据
向表中添加数据 Insert into 简单语法形式: Insert into 表名[(列名[,列名]...)] values(值 [,值],...);   Values 后面的值的排列要与into子句后面的列名排列一致; 若表名后面的所有列名省略,则values后的值的排列要与该表中存储的列名排列一致; “[]”表示其中的内容可省略。   示例: 1 向学生表中添加数据 I
插入数据出错:( insert into table
string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath(".") + "..\\database\\data.mdb";rnstring <em>insert</em>Str = "Insert into T_User (username,password) Values ('" + TextBox1.Text + "','" + TextBox2.Text + "')";rnOleDbConnection conn = new OleDbConnection(conStr);rnconn.Open();rnOleDbCommand comm = new OleDbCommand(<em>insert</em>Str,conn);rncomm.ExecuteNonQuery();rnconn.Close();rnResponse.Redirect("ok.aspx"); rn//rn为什么,单插username没有事,插入username和password就出错呢:(rn晕rn///rn出错提示rn//rnINSERT INTO 语句的语法错误。
在整合hibernate时报异常
今天在整合<em>hibernate</em>的时候出现了下面异常,在网上查了一些文章 http://blog.csdn.net/cheng_feng_xiao_zhan/article/details/52541361 发现主要有几种情况: JAR未引入实体类中缺少无参构造函数其他原因 排查后,发现是我自己在entities和hbm.xml文件的属性名映射不正确,修改之后就ok了!
spring整合hibernate时报的错
No Hibernate Session bound to thread, and configuration does not allow creat 问题描述:没有将session绑定到当前线程,网上查找原因:是没有配置事务导致                  class="org.springframework.orm.<em>hibernate</em>3.HibernateTransactio
hibernate could not commit
HIBERNATE在运行一段时间后出现<em>could</em> not commit的异常,有时候还会有<em>could</em> not query的异常一起出现。请问有可能是什么问题?
struts+spring+hibernate插入数据时的问题,高手进!
服务器jboss 开发工具eclipse+myeclipse 框架struts spring <em>hibernate</em> 在添加数据时总是报错,开源工具ant,xdocletrnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletExceptionrn org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:697)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:810)rn org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)rnrnrnroot cause rnrnjava.lang.NullPointerExceptionrn all.miyan.createuser(miyan.java:19)rn com.hitt.struts.action.DfAction.execute(DfAction.java:47)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:697)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:810)rn org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.5.9 rnrn希望大家帮助解决!
用SQL插入数据,在线等待。高手
例如表:rn机构名称 法人 地址 编码rn计算机职业中心 吴坤典 南京路东38号 571700rn思达计算机公司 葛洪波 泰山大厦130 571700rn新通计算机公司 里 人民中路108 571700rnrn显示成这样:rnrn第一类 第二类 机构名称 法人 地址 编码rn电子仪器 硬件及软件 计算机职业中 吴坤典 南京路东38号 571700rn电子仪器 硬件及软件 思达计算机公 葛洪波 泰山大厦130 571700rn电子仪器 硬件及软件 新通计算机公 里 人民中路108 571700rnrnrn就是在表前面插入两列,每列要显示成上面这样。还有字段一定要插在所有字段前面。用SQL语句怎么写啊rn请具体写出来,谢拉rnrn
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的组合。辛苦各位啦
hibernate保存数据时报java.lang.ClassCastException
使用的Spring+Hibernatern 在进行数据保存的时候 报java.lang.ClassCastExceptionrnCaused by: java.lang.ClassCastException: java.lang.Longrn at com.workflow.model.<em>hibernate</em>DaoImpl.HpmQshjbxxbDaoImpl.saveHpmQshjbxxb(HpmQshjbxxbDaoImpl.java:32)rn at com.workflow.model.service.impl.HpmQshjbxxbServiceImpl.saveHpmQshjbxxb(HpmQshjbxxbServiceImpl.java:33)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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy52.saveHpmQshjbxxb(Unknown Source)rn at com.workflow.jbpm.bean.TaskBean.saveBasicInfo(TaskBean.java:127)rn at com.workflow.jbpm.bean.TaskBean.saveAllInfo(TaskBean.java:76)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 org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)rn ... 36 morernrn相关的代码如下 日志错误的JAVA:32 就是以下打*的这行 rn public HpmQshjbxxb saveHpmQshjbxxb(HpmQshjbxxb hpmQshjbxxb) rn this.logger.info(hpmQshjbxxb.getProcessinstanceId());rn try rn //hpmQshjbxxb是从前台传过来的,确保非空。rn return (HpmQshjbxxb) this.getHibernateTemplate().save(hpmQshjbxxb);***********rn rn catch (HibernateException e) rn e.printStackTrace();rn throw e;rn rn rnrnrnVO的配置 以下是VO的 hbm.xmlrnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn以下是VO的POJOrnpackage com.workflow.model.vo;rnrnimport java.io.Serializable;rnrn/**rn * HpmQshjbxxb generated by MyEclipse Persistence Toolsrn */rnrnpublic class HpmQshjbxxb implements Serializablernrn // Fieldsrn private static final long serialVersionUID = 1L;rn private long qshtybh=0;rnrn private String qshmc;rnrn private String fddbr;rnrn private String fddbrzw;rnrn private String dwxz;rnrn private String hylb;rnrn private String txdz;rnrn private String yzbm;rnrn private long processinstanceId;rnrn// private Set hpmQsxksqxxbs = new HashSet(0);rnrn // Constructorsrnrn /** default constructor */rn public HpmQshjbxxb() rn rnrn /** minimal constructor */rn public HpmQshjbxxb(long qshtybh, long processinstanceId) rn this.qshtybh = qshtybh;rn this.processinstanceId = processinstanceId;rn rnrn /** full constructor */rn public HpmQshjbxxb(long qshtybh, String qshmc, String fddbr,rn String fddbrzw, String dwxz, String hylb, String txdz, String yzbm,rn long processinstanceId) rn this.qshtybh = qshtybh;rn this.qshmc = qshmc;rn this.fddbr = fddbr;rn this.fddbrzw = fddbrzw;rn this.dwxz = dwxz;rn this.hylb = hylb;rn this.txdz = txdz;rn this.yzbm = yzbm;rn this.processinstanceId = processinstanceId;rn // this.hpmQsxksqxxbs = hpmQsxksqxxbs;rn rnrn // Property accessorsrnrn public long getQshtybh() rn return this.qshtybh;rn rnrn public void setQshtybh(long qshtybh) rn this.qshtybh = qshtybh;rn rnrn public String getQshmc() rn return this.qshmc;rn rnrn public void setQshmc(String qshmc) rn this.qshmc = qshmc;rn rnrn public String getFddbr() rn return this.fddbr;rn rnrn public void setFddbr(String fddbr) rn this.fddbr = fddbr;rn rnrn public String getFddbrzw() rn return this.fddbrzw;rn rnrn public void setFddbrzw(String fddbrzw) rn this.fddbrzw = fddbrzw;rn rnrn public String getDwxz() rn return this.dwxz;rn rnrn public void setDwxz(String dwxz) rn this.dwxz = dwxz;rn rnrn public String getHylb() rn return this.hylb; rn rnrn public void setHylb(String hylb) rn this.hylb = hylb;rn rnrn public String getTxdz() rn return this.txdz;rn rnrn public void setTxdz(String txdz) rn this.txdz = txdz;rn rnrn public String getYzbm() rn return this.yzbm;rn rnrn public void setYzbm(String yzbm) rn this.yzbm = yzbm;rn rnrn public long getProcessinstanceId() rn return this.processinstanceId;rn rnrn public void setProcessinstanceId(long processinstanceId) rn this.processinstanceId = processinstanceId;rn rnrn
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是什么异常,如何解决呢?
Could not found jar: Hibernate?
官网下的zip..……为什么呢? 结果如图:rn
Oracle存储过程Insert插入数据进多个数据库并有返回值
create or replace procedure pro_sys_userrole( v_userid in varchar,--传入参数 v_roleid in varchar, v_num OUT VARCHAR2--返回参数 ) is v_sql varchar2(10000);--变量 begin   begin   v_sql:='<em>insert</em> into sys_user_rol...
关于insert into的一道难题,高手进来啊!
<em>insert</em> into TB01(1,2,3,4....n) select 1,2,3,...n from Tb02 where *******)rnrn以上是Tb01和Tb02字段相同的情况,rnrn现在我想解决的是.rnrnTB01有 n+1 个字段,rnrn而TB02只有n个字段rnrn我该怎么解决呢???rnrn比方说我想把aaa的值赋予地n+1个字段rnrn<em>insert</em> into TB01(1,2,3,4....n,n+1) select 1,2,3,...n from Tb02 where *******,aaa)rnrn关于<em>insert</em> into的一道难题,<em>高手</em>进来啊!
解决单元测试时报Could not instantiate问题
解决单元测试<em>时报</em>Could not instantiate appender named "LFS".问题,原因:缺少log4j配置文件。
插入数据insert语句)的解决方法
我想将teacher中数据导入userinfo中,其中userinfo表typed字段(teacher中没有)需自己赋值,typed=4 rnINSERT INTO userinforn (USERNAME, PASSWORD, NUM, REALNAME, DEPART)rnSELECT NUM, NUM , NUM , TEACHERNAME, DEPARTrn FROM TEACHERrn怎么办?本人初学者,各位老大帮帮忙!
Oracle insert 插入数据的几种方式
1、 <em>insert</em> 的单表插入INSERT INTO [()] VALUES();INSERT INTO SELECT FROM WHERE ...eg:SQL> create ta
你们插入数据都用INSERT吗????
操作数据库,rn你们用JAVABEAN<em>插入数据</em>都用INSERT吗?rn要是有上百个字段怎么办?rn有没有象ASP那样操作的,最后UPDATE,rn我见过别人用STMT、SETSTRING ();rn到底怎么写啊?
oracle 使用with insert插入数据的问题
今天有个写存储过程的朋友问我一个with a  as  。。。。<em>insert</em> 的存储过程为什么总是报错:ORA-00928: 缺失 SELECT 关键字 最后发现with后面只能直接跟select 不能跟<em>insert</em>,修改后解决问题 修改前: with  a as(SELECT T.StationId,U.Id AS UserId  FROM Sys_Station_In
hibernate插入数据没有反应
郁闷的我头疼,我实在搞不明白为什么了,我手动给good设置值之后,调用DAO层的create方法,<em>插入数据</em>库,控制台不提示错误,也显示了执行的SQL语句,可是数据库中没有数据!我手动往数据库中添加数据库,然后调用find方法,查到,而且一个一个的输出每个属性,也有值,可是为什么<em>插入数据</em>就不行呢?还有更新!我又建了一个TYPE类,可以插入!<em>高手</em>请指点一下小弟!感激不尽rn@Entityrn@Table(name = "tb_good")rnpublic class Good rn @Idrn @GeneratedValue(strategy = GenerationType.AUTO)rn private Integer id;rnrn @ManyToOne(cascade = CascadeType.PERSIST , fetch = FetchType.EAGER)rn @JoinColumn(name = "type_id")rn rn private GoodType goodType;rn private String name;rn private String code;rn private Integer num;rn private String XingHao;rn private Double price;rn private String picUrl;rn rn @Column(columnDefinition = "text")rn private String describe;rn private Integer isNew;rn rn @Temporal(value = TemporalType.DATE)rn private Date addNew;rn (省略get,set方法)rnrnrn[img=http://hi.csdn.net/attachment/201103/23/2426554_1300871436ZjO2.gif][/img]rnrnpublic void create(T object) rnrn Session session = HibernateSessionFactory.getSessionFactory()rn .openSession();rnrn try rn session.beginTransaction();rnrn session.persist(object);rnrn session.getTransaction().commit();rnrn catch (Exception e) rn session.getTransaction().rollback();rn finally rn session.close();rn rn rn
Hibernate插入数据出错??求助
用Hibernate做数据层rn当往单个表里插数据时抛出异常:rnException in thread "main" org.<em>hibernate</em>.HibernateException: Hibernate Dialect must be explicitly setrn是为什么呢?我的方言已经设置了rnorg.<em>hibernate</em>.dialect.MySQLDialectrnrn部分代码如下:Configuration config = new Configuration();rnSessionFactory factory = config.buildSessionFactory();rnthis.session = factory.openSession();rnTransaction tx = session.beginTransaction();rnthis.session.save(person);//person里已放好数据rntx.commit();rnthis.session.close();rnrn请帮忙解决!rn在线等待
hibernate 插入数据抛出异常
映射文件:rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn表结构:rn+---------+------------------+------+-----+---------+----------------+rn| Field | Type | Null | Key | Default | Extra |rn+---------+------------------+------+-----+---------+----------------+rn| id | int(10) unsigned | NO | PRI | NULL | auto_increment |rn| title | varchar(20) | NO | | NULL | |rn| content | varchar(500) | YES | | NULL | |rn| owner | varchar(20) | NO | | NULL | |rn| time | datetime | NO | | NULL | |rn| topicId | int(11) | NO | | NULL | |rn+---------+------------------+------+-----+---------+----------------+rnrn我<em>插入数据</em>的时候抛出异常rnorg.<em>hibernate</em>.exception.GenericJDBCException: Could not execute JDBC batch updatern........rn........rnCaused by: java.sql.BatchUpdateException: Data truncation: Data too long for column 'content' at row 1rnrn请各位<em>高手</em>帮帮我!谢谢rn
hibernate插入数据异常
(Hibernate operation): encountered SQLException [FOR UPDATE can not be used in arn SELECT which is not part of the declaration of a cursor or which is not insiderna stored procedure.rn]; nested exception is com.sybase.jdbc2.jdbc.SybSQLException: FOR UPDATE can notrn be used in a SELECT which is not part of the declaration of a cursor or which irns not inside a stored procedure.rn异常rn==============================rn主建生成用的native,sybase数据库,主建为identity类型的。大家帮忙看看
Hibernate插入数据问题
初学HIBERNATE,现成程序如下,不知道哪错了rnpublic ActionForward execute(ActionMapping mapping,rn ActionForm form,rn HttpServletRequest request,rn HttpServletResponse response) throws Exceptionrn rn //创建一个struts的form对象rn UserForm userform=new UserForm();rn //从form对象中得到值rn String name=userform.getvUserName();rn String password=userform.getvPassword();rn String calling=userform.getvCalling();rn rn //创建一个<em>hibernate</em>的pojo对象rn UserBase userbase=new UserBase();rn //把要插入的数据存放到userbase中rn userbase.setvUserName(name);rn userbase.setvPassword(password);rn userbase.setvCalling(calling);rn rn //创建Hibernate对象,<em>插入数据</em>rn SessionFactory sf=new Configuration().configure().buildSessionFactory();rn Session session=sf.openSession();rn Transaction tx=session.beginTransaction();rn rn tryrn session.save(userbase);rn tx.commit();rn session.close();rn rn catch(Exception e)rn e.printStackTrace();rn System.out.print("数据插入错误!");rn rn rn if(isCancelled(request))rn return mapping.findForward("cancel");rn rn return mapping.findForward("create");rn
MyBatis insert插入数据返回主键
方法一 &amp;lt;<em>insert</em> id=&quot;<em>insert</em>GetId&quot; useGeneratedKeys=&quot;true&quot; keyProperty=&quot;id&quot; parameterType=&quot;cn.com.xxx.mybatis.User&quot;&amp;gt;     <em>insert</em> into user(userName,password,sex)     values(#{userName},#{password},#{...
insert into每次都重复插入数据
就一句普通的<em>insert</em> into插入,但点确定后就插入了两条相同记录,是什么原因?
一个SqlDataSource insert插入数据问题
代码如下:rnrnrnrn rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn 卡号: rn 姓名: rn 性别:rn 男rn 女rn rn 年龄:rn 18rn 19rn 20rn 21rn 22rn 23rn 24rn 25rn 26rn 27rn rn 身份证: rn 学校:rn rn rn rn rn rn 电话: rn 手机: rn 会员级别:rn 普通会员rn 培训部实践卡rn rn 是否开通及时雨:rn 开通rn 不开通rn rn 售出方式:rn rn rn 促销rn rn 售出人:rn rn 公司员工:rn 李亮rn 杨军伟rn rn rn rnrnrn为什么TextBoxcard 等textbox的值不能插入呢?
hibernate 插入数据时的异常
如果是把字符串型的设置为主键,到<em>hibernate</em>里<em>插入数据</em>时不让插入怎么解决呀?
基于C51编写的可调时针下载
基于51单片机编写的可调时针,仅供下载者参考 相关下载链接:[url=//download.csdn.net/download/lspymjy/2847620?utm_source=bbsseo]//download.csdn.net/download/lspymjy/2847620?utm_source=bbsseo[/url]
关系数据库理论课件,数据库系统原理第6章下载
王珊第四版数据库系统原理第六章关系数据库理论课件 相关下载链接:[url=//download.csdn.net/download/hd_lwj/3296800?utm_source=bbsseo]//download.csdn.net/download/hd_lwj/3296800?utm_source=bbsseo[/url]
Myeclipse 10 for mac 安装过程及myeclipse 10 for mac 破解 说明下载
单独破解文件,我自己单独试过。失败。我看很多朋友已经下载好myeclipse10了。 相关下载链接:[url=//download.csdn.net/download/chevalier111/7649637?utm_source=bbsseo]//download.csdn.net/download/chevalier111/7649637?utm_source=bbsseo[/url]
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数
我们是很有底线的