0

There are a number of ways to call stored procedures in Spring using JdbcTemplate.

Calling stored procedures using JdbcTemplate has different approaches

  1. Using CallableStatementCreator based approach
  2. Extended abstract class StoredProcedure
  3. Using CallableStatement

May be other approaches also available but I know about these three only.

My questions is : What approach I should adopt and why should I adopt that i.e why that approach is better than other approaches, what are the advantages/disadvantages over other approaches.

I went through this Spring JDBC Template for calling Stored Procedures question but here users did not mentioned/explained why they followed a specific approach.

I want some comparison among different available approaches of JdbcTemplate for calling stored procedure so that I can choose the most efficient approach. Please guide me.

Community
  • 1
  • 1
Bacteria
  • 8,406
  • 10
  • 50
  • 67
  • refer to documentation @ https://docs.oracle.com/cd/E17952_01/connector-j-en/connector-j-usagenotes-statements-callable.html – Ravindra babu Aug 13 '15 at 18:28
  • @sunrise76 your provided link is irreverent to my question – Bacteria Aug 14 '15 at 07:33
  • That link covers one point : Connection.prepareCall() is an expensive method, due to the metadata retrieval that the driver performs to support output parameters. For performance reasons, minimize unnecessary calls to Connection.prepareCall() by reusing CallableStatement instances in your code – Ravindra babu Aug 14 '15 at 07:36
  • Out of the three, CallableStatement is most widely used. – Ravindra babu Aug 14 '15 at 07:38

0 Answers0