首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Mule CE 3.5 (任意点)中执行MSSQL存储过程

在Mule CE 3.5 (任意点)中执行MSSQL存储过程
EN

Stack Overflow用户
提问于 2014-08-28 09:32:12
回答 1查看 2.8K关注 0票数 0

在Mule CE 3.5 (任意点IDE)中执行MSSQL存储过程时,我收到了一条错误消息。

代码语言:javascript
运行
复制
******************************************************************************** 
Message : Query type must me '[STORE_PROCEDURE_CALL]' but was 'DDL' (java.lang.IllegalArgumentException). Message payload is of type: String 
Code : MULE_ERROR--2 
-------------------------------------------------------------------------------- 
Exception stack is: 
1. Query type must me '[STORE_PROCEDURE_CALL]' but was 'DDL' (java.lang.IllegalArgumentException) 
org.mule.module.db.internal.processor.AbstractDbMessageProcessor:164 (null) 
2. Query type must me '[STORE_PROCEDURE_CALL]' but was 'DDL' (java.lang.IllegalArgumentException). Message payload is of type: String (org.mule.api.MessagingException) 
org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/cur...) 

这是我的密码。

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.5.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">

    <db:generic-config name="db2_Database_Configuration" url="jdbc:sqlserver://localhost:1700;databaseName=db2;user=user;password=password;" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" doc:name="Generic Database Configuration"/>
    <flow name="DB_MSSQLFlow2" doc:name="DB_MSSQLFlow2">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="DB_MSSQL/sp" doc:name="HTTP"/>
        <db:stored-procedure config-ref="db2_Database_Configuration" doc:name="Database">
            <db:parameterized-query><![CDATA[EXEC GetAllJobs;]]></db:parameterized-query>
        </db:stored-procedure>
    </flow>
</mule>

但是,存储过程"GetAllJobs“可以在上执行,没有问题。

请帮帮我..。在正常情况下,select与参数一起工作的存储过程有什么问题?

谢谢,

卡林

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-08-28 10:55:44

在您的流中尝试这个<db:parameterized-query>{ call GetAllJobs }</db:parameterized-query>。因此,您的流量如下:

代码语言:javascript
运行
复制
    <db:generic-config name="db2_Database_Configuration" url="jdbc:sqlserver://localhost:1700;databaseName=db2;user=user;password=password;" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" doc:name="Generic Database Configuration"/>
   <flow name="DB_MSSQLFlow2" doc:name="DB_MSSQLFlow2">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="DB_MSSQL/sp" doc:name="HTTP"/>
     <db:stored-procedure config-ref="db2_Database_Configuration" doc:name="Database">
       <db:parameterized-query>{ call GetAllJobs }</db:parameterized-query>
     </db:stored-procedure>
  </flow>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25545431

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档