model.save()的时候一直报java.sql.SQLIntegrityConstraintViolationException: 调用中的无效参数

Caused by: java.sql.SQLIntegrityConstraintViolationException: 调用中的无效参数

at oracle.jdbc.driver.AutoKeyInfo.getNewSql(AutoKeyInfo.java:189)

at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:6679)

at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:512)

at com.alibaba.druid.wall.WallFilter.connection_prepareStatement(WallFilter.java:314)

at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:509)

at com.alibaba.druid.filter.FilterAdapter.connection_prepareStatement(FilterAdapter.java:962)

at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:176)

at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:509)

at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:366)

at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:447)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.jfinal.plugin.activerecord.SqlReporter.invoke(SqlReporter.java:58)

at com.sun.proxy.$Proxy5.prepareStatement(Unknown Source)

at com.jfinal.plugin.activerecord.Model.save(Model.java:403)

... 38 more

Caused by: java.sql.SQLException: 调用中的无效参数

at oracle.jdbc.driver.AutoKeyInfo.getReturnParamTypeCode(AutoKeyInfo.java:291)

at oracle.jdbc.driver.AutoKeyInfo.getNewSqlByColumnName(AutoKeyInfo.java:209)

at oracle.jdbc.driver.AutoKeyInfo.getNewSql(AutoKeyInfo.java:173)

... 54 more


评论区

JFinal

2018-07-20 18:02

oracle 不支持你的 model 生成的 sql,用 arp.setShowSql(true) 输出一下 sql ,看看 sql 有什么问题

此外,搜索一下 SQLIntegrityConstraintViolationException 这个异常是为啥

真的是菜鸟

2018-07-20 18:30

@JFinal 主键配置错了

热门反馈

扫码入社