Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 执行存储过程以选择数据-Mule 3.3.0_Sql Server_Sql Server 2008_Mule_Jtds - Fatal编程技术网

Sql server 执行存储过程以选择数据-Mule 3.3.0

Sql server 执行存储过程以选择数据-Mule 3.3.0,sql-server,sql-server-2008,mule,jtds,Sql Server,Sql Server 2008,Mule,Jtds,我试图执行一个存储过程,使用Mule 3.3.0从SQL Server 2008数据库中选择数据 在Mule文档中,有关于使用Oracle执行此操作的信息。我不确定SQL Server是否可以实现这一点 这是我的Mule端点配置 <jdbc:outbound-endpoint exchange-pattern="request-response" queryTimeout="-1" connector-ref="sqlServerConnector" queryKey="selectCou

我试图执行一个存储过程,使用Mule 3.3.0从SQL Server 2008数据库中选择数据

在Mule文档中,有关于使用Oracle执行此操作的信息。我不确定SQL Server是否可以实现这一点

这是我的Mule端点配置

<jdbc:outbound-endpoint exchange-pattern="request-response" queryTimeout="-1" connector-ref="sqlServerConnector" queryKey="selectCoupons" doc:name="Database">
    <jdbc:query key="selectCoupons" value="call sp_get_coupons()"/>
</jdbc:outbound-endpoint>
我正在使用jTDS驱动程序。用JDBC客户机测试存储过程,我得到了预期的结果集

有什么建议吗?

{ •P_返回状态:S, •管线识别号:684229, •p_流_状态_代码:已输入, •订购日期:2015年5月22日, •采购订单编号:69393
}从来没有做过那样的事。但是你会不会使用类似exec sp_389;的东西。。。。。这个调用看起来很奇怪。也许mule无法得到存储过程的结果,但它实际上已经执行了。您可以通过创建自己的存储过程来更新某些值来尝试此操作。您已经尝试过了。这就是我得到的:java.lang.IllegalArgumentException:没有为SQL语句找到SQL策略:exec sp_get_couponCall sp_get_是正确的语法。我知道问题出在哪里,Mule使用update而不是select,这使得jTDS很疯狂,但我不确定最佳修复方案。如何使用straight JDBC运行呼叫?@DavidDossot with straight JDBC我使用sp_get_优惠券,效果很好。我将尝试调用一个用户定义的函数,而不是一个存储过程,以查看它是否工作
Root Exception stack trace:
java.sql.SQLException: The executeUpdate method must not return a result set.
    at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:603)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
    at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:506)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)