CallableStatementCallback; bad SQL grammar

qq_27440341 2015-09-15 04:01:01
部分源码如下:
public String getSql() {
return "SP_DOM_VOYAGE_BASEPORT_CTN_RPT";
}

/**
*
* 设置传入存储过程或函数的参数
*/

@SuppressWarnings("unchecked")
public List getParameterList() {
List list = new ArrayList();
list.add(GuiUtil.isEmpty(selServiceLine.text.getText())?"":selServiceLine.getText());
list.add(GuiUtil.isEmpty(txtVesselCode.getText())?"":txtVesselCode.getText());
list.add(GuiUtil.isEmpty(txtVoyageNo.getText())?"":txtVoyageNo.getText());
list.add(GuiUtil.isEmpty(cboLeg.getText())?"":cboLeg.getTextValue());
list.add(GuiUtil.isEmpty(dtpAtaFrom.text.getText())?"":dtpAtaFrom.text.getText());
list.add(GuiUtil.isEmpty(dtpAtaTo.text.getText())?"":dtpAtaTo.text.getText());
return list;
}

//设置第几个参数为返回的游标
public int[] getOutputLocation() {
return new int[] { };
}
/*
* 设置报表的标题
*/
public String getReportTitle() {
return getMessage(this.titleKey);
}
/**
*
* 设置传入报表的外部对象
*/
public Map getAppContext() {
return null;
}
/**
*
* 设置传入报表的参数
*/
@SuppressWarnings("unchecked")
public Map getReprotParams() {
Map<String, Object> params = new HashMap<String, Object>();
setProcedureParams(params);
return params;
}

/**
* 设置存储过程输入输出参数 存储过程参数、存储过程名称、游标索引数组、游标类型数组在客户端的 context 作用域配置
*/
private void setProcedureParams(Map<String, Object> params) {
List procedureParams = new ArrayList();
procedureParams=setParams(new String[]{"serviceLine","vesselCode","voyageNo","leg","atdFrom","atdTo"}, procedureParams,params);
params.put("procedureParams", procedureParams);
params.put("procedureName", "SP_DOM_VOYAGE_BASEPORT_CTN_RPT");
params.put("cursorIndexs", new int[] { procedureParams.size() });
params.put("curosrTypes", new HashMap<Integer, Integer>());
params.put("serviceLine", GuiUtil.isEmpty(selServiceLine.text.getText())?"":selServiceLine.text.getText());
params.put("atdFrom", GuiUtil.isEmpty(dtpAtaFrom.text.getText())?"":dtpAtaFrom.text.getText());
params.put("atdTo", GuiUtil.isEmpty(dtpAtaTo.text.getText())?"":dtpAtaTo.text.getText());
}



/**
* 查询
*/
@Override
protected void doSearchAction() {
super.doSearchAction();
try {
// HelperService helperService = super.getHelperService();
// List<Map<String, Object>> list=helperService.queryProcedure(this.getParameterList(), this.getSql());
// System.out.println(list.size());getReportName()
// + "_" + System.currentTimeMillis()
viewer.view(getReportName(), this.getSql(), getParameterList(),
this.getOutputLocation(), this.getAppContext(), this
.getReprotParams(), getFormat(), System
.getProperty("java.io.tmpdir"), "船舶航次基港箱量统计分期表");
} catch (FileNotFoundException ex) {
Dialog.openInformationDialog("另一个程序正在使用此文件,进程无法访问!");
} catch (Exception e) {
GuiUtil.doException(e);
}
}


报错:
WARN ExceptionHandle:128 - org.springframework.jdbc.BadSqlGrammarException: CallableStatementCallback; bad SQL grammar [{call SP_DOM_VOYAGE_BASEPORT_CTN_RPT(?, ?, ?, ?, ?, ?, ?)}]
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:952)
at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:985)
at org.springframework.jdbc.object.StoredProcedure.execute(StoredProcedure.java:117)
at com.gfa4j.dao.impl.CommonDAOHibernateImpl.executeStoredProcedure(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1459.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.gemship.common.service.impl.LoggerServiceImpl.invoke(LoggerServiceImpl.java:81)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.gfa4j.acl.AclDAOInterceptor.invoke(Unknown Source)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy0.executeStoredProcedure(Unknown Source)
at com.gfa4j.service.impl.BaseServiceImpl.executeStoredProcedure(BaseServiceImpl.java:495)
at com.gemship.common.service.impl.HelperServiceImpl.queryProcedure(HelperServiceImpl.java:148)
at com.gemship.common.service.impl.HelperServiceImpl.queryProcedure(HelperServiceImpl.java:162)
at sun.reflect.GeneratedMethodAccessor1457.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy22.queryProcedure(Unknown Source)
at com.gemship.birt.service.impl.CommonReportServiceImpl.getReport(CommonReportServiceImpl.java:65)
at sun.reflect.GeneratedMethodAccessor14100.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:77)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy2410.getReport(Unknown Source)
at sun.reflect.GeneratedMethodAccessor14150.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205)
at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)
at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)
at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)
at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:74)
at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:440)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.gfa4j.web.SessionFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:595)
at org.springframework.remoting.support.RemoteInvocationUtils.fillInClientStackTraceIfPossible(RemoteInvocationUtils.java:43)
at org.springframework.remoting.support.RemoteInvocationResult.recreate(RemoteInvocationResult.java:105)
at org.springframework.remoting.support.RemoteInvocationBasedAccessor.recreateRemoteInvocationResult(RemoteInvocationBasedAccessor.java:80)
...全文
688 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

22,207

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧