oracle connect_by_root 这个问题请教各位大神

sql是这么写的

select id ,connect_by_root(id)   from DJGL_DJGLJ start with  PARENT_ID = ? connect by prior  id = d.PARENT_ID


错误是:

 ERROR 2018/01/26 10:56:54:277  com.jfinal.core.ActionHandler.handle(ActionHandler.java:135)  /dzqt/statistics/getCurrentOrgYearReportCount com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: sql injection violation, syntax error: TODO : RPAREN id : 

  select  id,connect_by_root( id)   from DJGL_DJGLJ   start with  PARENT_ID = ? connect by prior  id =  PARENT_ID

 

at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:345)

at com.jfinal.plugin.activerecord.Db.find(Db.java:232)

at com.wlgj.xtjc.biz.dzqt.statistics.DzqtStatisticsService.queryYearReportCountList(DzqtStatisticsService.java:39)

at com.wlgj.xtjc.biz.dzqt.statistics.DzqtStatisticsService$$EnhancerByCGLIB$$75e49dca.CGLIB$queryYearReportCountList$2(<generated>)

at com.wlgj.xtjc.biz.dzqt.statistics.DzqtStatisticsService$$EnhancerByCGLIB$$75e49dca$$FastClassByCGLIB$$436a2584.invoke(<generated>)

at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)

at com.jfinal.aop.Invocation.invoke(Invocation.java:82)

at com.jfinal.aop.Callback.intercept(Callback.java:96)

at com.wlgj.xtjc.biz.dzqt.statistics.DzqtStatisticsService$$EnhancerByCGLIB$$75e49dca.queryYearReportCountList(<generated>)

at com.wlgj.xtjc.biz.dzqt.statistics.DzqtStatisticsService.getJsonStr(DzqtStatisticsService.java:58)

at com.wlgj.xtjc.biz.dzqt.statistics.DzqtStatisticsService$$EnhancerByCGLIB$$75e49dca.CGLIB$getJsonStr$0(<generated>)

at com.wlgj.xtjc.biz.dzqt.statistics.DzqtStatisticsService$$EnhancerByCGLIB$$75e49dca$$FastClassByCGLIB$$436a2584.invoke(<generated>)

at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)

at com.jfinal.aop.Invocation.invoke(Invocation.java:82)

at com.jfinal.aop.Callback.intercept(Callback.java:96)

at com.wlgj.xtjc.biz.dzqt.statistics.DzqtStatisticsService$$EnhancerByCGLIB$$75e49dca.getJsonStr(<generated>)

at com.wlgj.xtjc.biz.dzqt.statistics.DzqtStatisticsController.getCurrentOrgYearReportCount(DzqtStatisticsController.java:41)

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

at 

这个问题怎么解决的。

@JFinal 

评论区

JFinal

2018-01-26 18:13

检查是否配置了方言: OracleDialect

如果确实配置了,那么是 sql 语法错误,老老实实将 sql 改正确即可

燕龙910

2018-01-27 11:13

@JFinal 首先方言配置了:arp.setDialect(new OracleDialect());, sql语法没有错误,反馈这个问题时,发现下复制错了,正确是这个:select id ,connect_by_root(id) from DJGL_DJGLJ start with PARENT_ID = ? connect by prior id = PARENT_ID,经过我多方查询是使用durid时出现的问题,把这个sql拦截了,检验sql没有通过,这里主要用了connect_by_root,才报到的错。

JFinal

2018-01-27 12:08

@燕龙910 看下 druid 的文档,将限制取消掉,通常会提供相应的配置

燕龙910

2018-02-02 15:32

@JFinal 谢谢,我找到了。

a893225050

2019-02-21 16:48

@JFinal @燕龙910 请问两位大神具体取消这个限制 ,具体咋配置的,看文档没找到呢

热门反馈

扫码入社