日期:2014-05-17  浏览次数:20898 次

用的hibernate把sqlserver换成oracle报错!
有个项目用的hibernate,把数据库从sqlserver换成oracle后就报了很多错误,主要是ORA-00933: SQL 命令未正确结束,求各位大神指点啊,谢谢!

前面还有一堆sql......
Hibernate: select count(this_.id) as y0_ from bbscs_forum this_ where this_.BoardID=? and this_.DelSign=? and this_.Auditing=?
Hibernate: select count(this_.id) as y0_ from bbscs_forum_history this_ where this_.BoardID=? and this_.DelSign=? and this_.Auditing=?
Hibernate: select board0_.id as col_0_0_ from bbscs_board board0_ where board0_.ParentID=? and board0_.UseStat=1 order by board0_.Orders asc
2013-10-29 09:26:23,720 [com.laoer.bbscs.service.imp.BoardServiceCacheImp]-[INFO] postMainNum:103 postNum:110
192.168.47.17
Hibernate: select * from ( select commend0_.id as id15_, commend0_.BoardCategory as BoardCat2_15_, commend0_.BoardID as BoardID15_, commend0_.BoardName as BoardName15_, commend0_.CommendBoardID as CommendB5_15_, commend0_.CommendTop as CommendTop15_, commend0_.CreateTime as CreateTime15_, commend0_.PostID as PostID15_, commend0_.PostMainID as PostMainID15_, commend0_.Title as Title15_, commend0_.TopCategory as TopCate11_15_, commend0_.UserID as UserID15_, commend0_.UserName as UserName15_ from bbscs_commend commend0_ where commend0_.CommendTop=? order by commend0_.CreateTime desc ) where rownum <= ?
2013-10-29 09:26:23,751 [com.laoer.bbscs.service.task.BoardCountTimerTask]-[INFO] Board count end
java.sql.SQLSyntaxErrorException: ORA-00933: SQL 命令未正确结束

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3493)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:487)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<