NutzCN Logo
问答 执行自定义sql出错...
发布于 2663天前 作者 蛋蛋的忧伤 1369 次浏览 复制 上一个帖子 下一个帖子
标签:

代码:

 Sql sql = Sqls.create("select F.PROCESSLOCATION,f.instance_status,f.processdefinition_key,f.PROCESSLOCATION,f.biz_key,f.start_time,f.update_time,f.subject,f.processinstance_id,id,review_no,contract_no,pstc_dept,review_status,review_type,login_person,login_date,gs_dept,company_dept,gs_area,industry_type,industry,customer_type,consumer_name,consumer_name_short,consumer_no,contractor_id,is_new_consumer,new_consumer_desc,consumer_province,project_name,tender_name,tender_no,project_progress,contacts_name,sign_date,amount,is_sw_amount,start_production_rqmt,is_start_production,launch_man,launch_time,manager_approval,predict_date,actual_date,start_dt,entry_userid,review_contents,is_fine,fine_memo,contract_type,change_type,start_product_flg,is_audit,is_submit,contract_login_flag,contract_login_date,contract_login_person,contract_gs_dept,achrive_person,audit_date,audit_person,outsource_sum,detail_sum,review_status1,review_status2,x.review_tp,x.spare2,x.spare3,x.is_two_review,x.have_read from wsd_contract_review_info x left join fixflow_run_processinstance f on   f.biz_key=x.id and ( f.processdefinition_key = 'contractReviewYXFlow' or f.processdefinition_key = 'contractChangeReviewYXFlow')  where 1=1   and  f.initiator='DF010369' and (  f.biz_key is not null ) and f.INSTANCE_STATUS = 'RUNNING';");
        sql.setCallback(new SqlCallback() {
            public Object invoke(Connection conn, ResultSet rs, Sql sql) throws SQLException {
                List<String> list = new LinkedList<String>();
                while (rs.next())
                    list.add(rs.getString("name"));
                return list;
            }
        });
        dao.execute(sql);
        return sql.getList(String.class);

日志:

[DEBUG] 10:38:55.523 me.zouooh.mvc.LogTimeProcessor.process(LogTimeProcessor.java:27) - [ GET] /api/work/meContractList 11112ms
[WARN ] 10:38:55.524 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) - Error@/work/meContractList :
org.nutz.dao.DaoException: !Nutz SQL Error: 'select F.PROCESSLOCATION,f.instance_status,f.processdefinition_key,f.PROCESSLOCATION,f.biz_key,f.start_time,f.update_time,f.subject,f.processinstance_id,id,review_no,contract_no,pstc_dept,review_status,review_type,login_person,login_date,gs_dept,company_dept,gs_area,industry_type,industry,customer_type,consumer_name,consumer_name_short,consumer_no,contractor_id,is_new_consumer,new_consumer_desc,consumer_province,project_name,tender_name,tender_no,project_progress,contacts_name,sign_date,amount,is_sw_amount,start_production_rqmt,is_start_production,launch_man,launch_time,manager_approval,predict_date,actual_date,start_dt,entry_userid,review_contents,is_fine,fine_memo,contract_type,change_type,start_product_flg,is_audit,is_submit,contract_login_flag,contract_login_date,contract_login_person,contract_gs_dept,achrive_person,audit_date,audit_person,outsource_sum,detail_sum,review_status1,review_status2,x.review_tp,x.spare2,x.spare3,x.is_two_review,x.have_read from wsd_contract_review_info x left join fixflow_run_processinstance f on   f.biz_key=x.id and ( f.processdefinition_key = 'contractReviewYXFlow' or f.processdefinition_key = 'contractChangeReviewYXFlow')  where 1=1   and  f.initiator='DF010369' and (  f.biz_key is not null ) and f.INSTANCE_STATUS = 'RUNNING';'
PreparedStatement: 
'select F.PROCESSLOCATION,f.instance_status,f.processdefinition_key,f.PROCESSLOCATION,f.biz_key,f.start_time,f.update_time,f.subject,f.processinstance_id,id,review_no,contract_no,pstc_dept,review_status,review_type,login_person,login_date,gs_dept,company_dept,gs_area,industry_type,industry,customer_type,consumer_name,consumer_name_short,consumer_no,contractor_id,is_new_consumer,new_consumer_desc,consumer_province,project_name,tender_name,tender_no,project_progress,contacts_name,sign_date,amount,is_sw_amount,start_production_rqmt,is_start_production,launch_man,launch_time,manager_approval,predict_date,actual_date,start_dt,entry_userid,review_contents,is_fine,fine_memo,contract_type,change_type,start_product_flg,is_audit,is_submit,contract_login_flag,contract_login_date,contract_login_person,contract_gs_dept,achrive_person,audit_date,audit_person,outsource_sum,detail_sum,review_status1,review_status2,x.review_tp,x.spare2,x.spare3,x.is_two_review,x.have_read from wsd_contract_review_info x left join fixflow_run_processinstance f on   f.biz_key=x.id and ( f.processdefinition_key = 'contractReviewYXFlow' or f.processdefinition_key = 'contractChangeReviewYXFlow')  where 1=1   and  f.initiator='DF010369' and (  f.biz_key is not null ) and f.INSTANCE_STATUS = 'RUNNING';'
CaseMessage=ORA-00911: 无效字符

	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:96)
	at org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:187)
	at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:334)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:59)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:257)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:289)
	at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:253)
	at org.nutz.dao.impl.NutDao.execute(NutDao.java:983)
	at com.yixin.wsd.api.controller.WorkController.meContractList(WorkController.java:80)
	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:498)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:25)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at me.zouooh.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198)
	at com.yixin.wsd.api.mvc.WeixinFilter.doFilter(WeixinFilter.java:45)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

	at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
	at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
	at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:780)
	at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:855)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
	at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1377)
	at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:387)
	at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2363)
	at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2481)
	at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:302)
	at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2360)
	at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.executeQuery(StatementProxyImpl.java:211)
	at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:138)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:199)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:45)
	... 65 more

sql语句是没问题的,我在数据库直接跑没问题

1 回复

妈的,加了个分号的问题......

添加回复
请先登陆
回到顶部