在oracle10g中写了一个function,利用
@NamedNativeQuery(name = "addUser", query = "{call addUser(:pPortalID,:ploginid,:ploginpasswd,:pSelfQuiz,:pSelfAnswer,:pUserEmail)}", hints = { @QueryHint(name = "org.hibernate.callable", value = "true") }, resultClass = User.class)
来调用函数addUser,但是在运行时总是提示:
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:108)
at com.igrs.sso.dao.impl.UserDAOImpl.addUser(UserDAOImpl.java:59)
at com.igrs.sso.service.impl.UserServiceImpl.addUser(UserServiceImpl.java:41)
at com.igrs.sso.page.SignupForm.submit(SignupForm.java:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod(ListenerMethodInvokerImpl.java:276)
at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:221)
at org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke(ListenerMethodInvokerImpl.java:157)
at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:80)
at org.apache.tapestry.listener.SyntheticListener.actionTriggered(SyntheticListener.java:52)
at org.apache.tapestry.binding.ListenerMethodBinding.actionTriggered(ListenerMethodBinding.java:77)
at org.apache.tapestry.listener.ListenerInvokerTerminator.invokeListener(ListenerInvokerTerminator.java:50)
at $ListenerInvoker_115a65efa94.invokeListener($ListenerInvoker_115a65efa94.java)
at $ListenerInvoker_115a65efa93.invokeListener($ListenerInvoker_115a65efa93.java)
at org.apache.tapestry.form.Form.renderComponent(Form.java:200)
at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:725)
at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:180)
at org.apache.tapestry.form.Form.rewind(Form.java:269)
at org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:453)
at org.apache.tapestry.form.Form.trigger(Form.java:280)
at org.apache.tapestry.engine.DirectService.triggerComponent(DirectService.java:166)
at org.apache.tapestry.engine.DirectService.service(DirectService.java:142)
at $IEngineService_115a65efb0c.service($IEngineService_115a65efb0c.java)
at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:237)
at org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
at $WebRequestServicer_115a65efad7.service($WebRequestServicer_115a65efad7.java)
at $WebRequestServicer_115a65efad3.service($WebRequestServicer_115a65efad3.java)
at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
at $ServletRequestServicer_115a65efac5.service($ServletRequestServicer_115a65efac5.java)
at org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
at $ServletRequestServicerFilter_115a65efac1.service($ServletRequestServicerFilter_115a65efac1.java)
at $ServletRequestServicer_115a65efac7.service($ServletRequestServicer_115a65efac7.java)
at org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
at $ServletRequestServicerFilter_115a65efabf.service($ServletRequestServicerFilter_115a65efabf.java)
at $ServletRequestServicer_115a65efac7.service($ServletRequestServicer_115a65efac7.java)
at org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
at $ServletRequestServicerFilter_115a65efac3.service($ServletRequestServicerFilter_115a65efac3.java)
at $ServletRequestServicer_115a65efac7.service($ServletRequestServicer_115a65efac7.java)
at $ServletRequestServicer_115a65efab9.service($ServletRequestServicer_115a65efab9.java)
at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:126)
at org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:171)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
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)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2223)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:82)
... 58 more
Caused by: java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00221: 'ADDUSER' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4223)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)
at org.hibernate.dialect.MySQLDialect.getResultSet(MySQLDialect.java:316)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:193)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1784)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
... 65 more
,请问这是怎么回事?难道只能调用存储过程而不能调用函数吗?
分享到:
相关推荐
11.5.8. 使用SimpleJdbcCall调用内置函数 11.5.9. 使用SimpleJdbcCall返回的ResultSet/REF Cursor 11.6. 用Java对象来表达JDBC操作 11.6.1. SqlQuery类 11.6.2. MappingSqlQuery类 11.6.3. SqlUpdate类 11.6.4...
11.5.8. 使用SimpleJdbcCall调用内置函数 11.5.9. 使用SimpleJdbcCall返回的ResultSet/REF Cursor 11.6. 用Java对象来表达JDBC操作 11.6.1. SqlQuery类 11.6.2. MappingSqlQuery类 11.6.3. SqlUpdate类 11.6.4...
13. **枚举和注解**:枚举类型的应用,以及注解(Annotation)在元编程中的作用,如Spring框架中的@Component。 14. **反射机制**:通过反射获取类的信息,动态创建对象,调用方法,修改属性值。 15. **Java Swing...
在Java程序设计中,以下几个关键知识点是不可或缺的: 1. **Java简介**:Java是一种跨平台的面向对象的编程语言,由Sun Microsystems(现已被Oracle收购)于1995年推出。它的“一次编写,到处运行”(Write Once, ...
1. **语法结构**:Java的基础包括变量、数据类型、常量、运算符、流程控制(如if-else,switch,for,while等循环结构),以及函数的定义与调用。 2. **类与对象**:理解面向对象编程的核心概念,如封装、继承和多态...
学习资源包括书籍和视频,如《Java就业培训教程》、《Java就业培训教程视频》、《从实践中学习Oracle/SQL》和《传智播客JDBC视频》等。 4. **Web开发基础**: - **HTML/CSS/JavaScript**:掌握网页开发的基础,...
Java是一种广泛使用的面向对象的编程语言,由Sun Microsystems(现为Oracle公司)于1995年发布。Java的设计目标是具有高度的可移植性、安全性、健壮性和性能,使其能够在各种平台和设备上运行,包括个人电脑、服务器...
Java编程语言是软件开发领域中最常用的语言之一,尤其在企业级应用中占据主导地位。"JavaBasic:그래밍로프기초" 提供了一个初学者理解Java编程基础的框架。这个压缩包文件“JavaBasic-master”很可能是包含了一系列...
1. **Java基础**:Java是一种面向对象的编程语言,由Sun Microsystems(现为Oracle公司)开发。学习Java应从基础开始,包括数据类型、变量、运算符、流程控制语句(如if-else、for、while)、方法定义和调用。 2. *...
Java是一种广泛使用的面向对象的编程语言,由Sun Microsystems(现为Oracle公司的一部分)于1995年发布。它的设计目标是实现“一次编写,到处运行”,这得益于Java虚拟机(JVM)的存在,它允许Java程序在任何支持...
以上是Java语言的一些核心知识点,但Java生态还包括Spring框架、JPA(Java Persistence API)、MyBatis、JUnit测试框架等众多库和工具,这些都可能在GET2021活动中被讨论。由于没有具体的会议日程或内容,我们无法...
在Java编程中,以下几个关键领域是必不可少的: 1. **基础概念**:Java是一种面向对象的编程语言,由Sun Microsystems(现为Oracle Corporation)于1995年发布。学习Java应从基础语法开始,包括变量、数据类型、...
Java是一种广泛使用的面向对象的编程语言,由Sun Microsystems(现为Oracle公司的一部分)于1995年发布。它的设计目标是简洁、可移植、健壮和高效,这些特性使得Java成为开发各种类型应用程序的理想选择,包括桌面...