首页 新闻 搜索 专区 学院

jfinal的Db.save报java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

0
悬赏园豆:5 [已关闭问题] 关闭于 2017-05-12 16:05

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

//贴代码

Record lo=new Record()
.set("TESTWAYNAME",linShierrorload.getTestwayname())
.set("RANGENO",linShierrorload.getRangeno())
.set("POINTNO",linShierrorload.getPointno())
.set("POINTNAME",linShierrorload.getPointname())
.set("TESTTIME",linShierrorload.getTesttime())
.set("CIRCLES",linShierrorload.getCircles())
.set("TIMER",linShierrorload.getTimer())
.set("DELAY",linShierrorload.getDelay())
.set("UPLIMIT",linShierrorload.getUplimit())
.set("DOWNLIMIT",linShierrorload.getDownlimit())
.set("INCONTROL",linShierrorload.getIncontrol())
.set("SMAXLIMIT",linShierrorload.getSmaxlimit())
.set("ISTIP",linShierrorload.getIstip())
.set("IMBALANCE",linShierrorload.getImbalance())
.set("CONSTNO",linShierrorload.getConstno())
.set("ZCBIANHAO",linShierrorload.getZcbianhao())
.set("TESTTIMES",linShierrorload.getTesttimes())
.set("CSMAXLIMIT",linShierrorload.getCsmaxlimit())
.set("INCONTROLVALUE",linShierrorload.getIncontrolvalue())
.set("CREATETIME",linShierrorload.getCreatetime());
Db.save("表名", lo);

问题补充:

表中没有设置主键

报错如下:

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

at com.jfinal.plugin.activerecord.DbPro.save(DbPro.java:588)
at com.jfinal.plugin.activerecord.DbPro.save(DbPro.java:598)
at com.jfinal.plugin.activerecord.Db.save(Db.java:390)
at com.ydtf.sjqy.service.bzb.BzbService.saveLinshiErrorload(BzbService.java:261)
at com.ydtf.sjqy.controller.bzb.BzbJDLinShiController.saveLinshiErrorload(BzbJDLinShiController.java:99)
at com.ydtf.sjqy.controller.bzb.BzbJDLinShiController.bzbLinshiShuJu(BzbJDLinShiController.java:43)
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.aop.Invocation.invoke(Invocation.java:73)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3665)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1352)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
at com.jfinal.plugin.activerecord.DbPro.save(DbPro.java:552)
at com.jfinal.plugin.activerecord.DbPro.save(DbPro.java:586)

 

第588 行 :jfinal的

 

public boolean save(String tableName, String primaryKey, Record record) {
Connection conn = null;
try {
conn = config.getConnection();
return save(config, conn, tableName, primaryKey, record);
} catch (Exception e) {
throw new ActiveRecordException(e);
} finally {
config.close(conn);
}
}

初学者2号的主页 初学者2号 | 初学一级 | 园豆:22
提问于:2017-05-10 17:25
< >
分享
所有回答(2)
0

看看的你的sql语句中,是不是多了一个“;”!!!!!

吉吉的城 | 园豆:556 (小虾三级) | 2017-05-10 20:51

多了一个“;”号

支持(0) 反对(0) 吉吉的城 | 园豆:556 (小虾三级) | 2017-05-10 20:54

看不到,SQL没有打出来

支持(0) 反对(0) 初学者2号 | 园豆:22 (初学一级) | 2017-05-11 10:24

@吉吉的城: SQL没打印出来就报错了

支持(0) 反对(0) 初学者2号 | 园豆:22 (初学一级) | 2017-05-11 10:25

@初学者2号: 你试着把你贴的代码倒数第二个“;”号去掉试一下

支持(0) 反对(0) 吉吉的城 | 园豆:556 (小虾三级) | 2017-05-11 10:45
0

由于参数个数不对,所以没有SQL生成,后来改用 Db.batch就可以了

初学者2号 | 园豆:22 (初学一级) | 2017-05-12 16:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册