1.问题:Hibernate: select nextval ('SEQ_RESOURCES') [2011-05-25 14:59:50,671 ERROR]>> org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:78): - ORA-00923: 未找到要求的 FROM 关键字
解决方案:数据库方言配错了。 连接方式
2.问题:
- org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
- org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java: 103 )
- org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java: 91 )
- org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java: 43 )
- org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java: 202 )
- org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java: 235 )
- org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java: 140 )
- org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java: 297 )
- org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java: 27 )
- org.hibernate.impl.SessionImpl.flush(SessionImpl.java: 985 )
- org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java: 333 )
- org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java: 106 )
- org.qpyong.emp.dao.WorkersInfoDAO.merge(WorkersInfoDAO.java: 191 )
- org.qpyong.emp.servlet.EmployeeServlet.actionForUpdate(EmployeeServlet.java: 323 )
- org.qpyong.emp.servlet.EmployeeServlet.doPost(EmployeeServlet.java: 56 )
- javax.servlet.http.HttpServlet.service(HttpServlet.java: 709 )
- javax.servlet.http.HttpServlet.service(HttpServlet.java: 802 )
- org.qpyong.emp.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java: 40 )
- org.qpyong.emp.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java: 40 )
- note The full stack trace of the root cause is available in the Apache Tomcat/ 5.0 . 28 logs.
- 解决方案:注意到以上代码中 红色粗体 字 没有?刚开始我怎么也找不到原因。然后在之后的不段测试中,无意间解决了问题。即:发生这个错误的很可能的原因就是:这个对象对应的表的某个(些)字段的长度不够。比如我原来的数据库中的 workdate 字段是 DATE 类型,长度是8 。后来我把其类型改为VARCHAR ,但我却忘了把其长度改了过来,因为在页面中我使用的是日历控件,所以长度为11 位。所以就抛出了这个异常。