开发者社区> 问答> 正文

jfinal save 方法 报错 ?报错

可以@jfinal

sql 插入没问题

就这就话 

if (getModel(T_ORGAN.class).set("ORG_ID", AutoId.nextval("T_ORGAN")).save()) {

执行不下去

七月 15, 2015 11:41:23 上午 com.jfinal.core.ActionHandler error

严重: /system/organ/add
com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: 调用中的无效参数
at com.jfinal.plugin.activerecord.Model.save(Model.java:375)
at com.lauvan.system.controller.OrganController.add(OrganController.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.jfinal.aop.Invocation.invoke(Invocation.java:71)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:365)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: 调用中的无效参数
at oracle.jdbc.driver.AutoKeyInfo.getReturnParamTypeCode(AutoKeyInfo.java:196)
at oracle.jdbc.driver.AutoKeyInfo.getNewSqlByColumnName(AutoKeyInfo.java:114)
at oracle.jdbc.driver.AutoKeyInfo.getNewSql(AutoKeyInfo.java:88)
at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:6429)
at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:155)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.jfinal.plugin.activerecord.SqlReporter.invoke(SqlReporter.java:58)
at com.sun.proxy.$Proxy6.prepareStatement(Unknown Source)
at com.jfinal.plugin.activerecord.Model.save(Model.java:365)
... 31 more

展开
收起
爱吃鱼的程序员 2020-06-12 15:50:51 515 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    知道问题在哪了。

    @TableBind(name="T_ORGAN", pk="ORG_ID")
    publicclassT_ORGANextendsModel<T_ORGAN>{

    上写了红色部分

    太扯淡了。

    @jfinal刚刚玩这个框架就出现这样的问题 我用的是最新的jfinal确保  AutoId.nextval("T_ORGAN")这个拿到值了?我觉得应该是  AutoId.nextval("T_ORGAN")这里拿到了null,楼主看看
    2020-06-12 15:51:07
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Wicket User Guide - Ref 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载