5

When calling a Stored Procedure with no arguments and no output is there any advantage to using a CallableStatement over a regular Statement or PreparedStatement?

C. Ross
  • 31,137
  • 42
  • 147
  • 238

1 Answers1

5

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;";
Powerlord
  • 87,612
  • 17
  • 125
  • 175