简体   繁体   English

Java / Spring-存储过程调用字符串中的差异

[英]Java/Spring - Difference in Stored Procedure call string

What is the difference between 之间有什么区别

private static final String STORED_PROC_CALL_STRING = "{? = call dbo.test1(?,?,?,?)}"; 

and

private static final String STORED_PROC_CALL_STRING = "{call dbo.test2(?,?,?,?)}"; 

More specifically: what is the meaning behind the ? = 更具体地说:后面的含义是? = ? = at the beginning of the first statement, and how can I determine if the stored procedure I'm calling (on SQL Server) requires this or not? ? =在第一条语句的开头,我如何确定我正在调用的存储过程(在SQL Server上)是否需要此条件?

Edit: I intend to create a CallableStatement and use the .prepareCall() method on it with the string supplied as a parameter. 编辑:我打算创建一个CallableStatement并在其上使用.prepareCall()方法,并将字符串作为参数提供。

Thanks 谢谢

This first syntax with the "?" 这第一个语法带有“?” mark in the beginning refers to a " stored procedure with return status ", that will be returned by procedure. 开头的标记表示“ 具有返回状态的存储过程 ”,它将由过程返回。 This status is returned by procedure directly by using RETURN clause, you can check your procedure code and see it there. 通过使用RETURN子句,过程直接返回此状态,您可以检查过程代码并在其中查看。 The second one is just a call of your procedure with input (and possibly output) parameters. 第二个只是使用输入(可能是输出)参数的过程调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM