开发者

CallableStatement vs Statement

开发者 https://www.devze.com 2023-01-12 21:58 出处:网络
When calling a Stored Procedure with no arguments and no output is there any advantage t开发者_Go百科o using a CallableStatement over a regular Statement or PreparedStatement?CallableStatement allows

When calling a Stored Procedure with no arguments and no output is there any advantage t开发者_Go百科o using a CallableStatement over a regular Statement or PreparedStatement?


CallableStatement allows you to use a generic JDBC syntax for calling procedures rather than a Database specific one.

Sadly, we didn't do that for Oracle in one of the projects I've worked on, so all our procedure calls look something like this:

String query = "begin package.sp_Procedure(?, ?); end;";
0

精彩评论

暂无评论...
验证码 换一张
取 消