Announcement Announcement Module
No announcement yet.
Call Stored Procedures from a generic class Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Call Stored Procedures from a generic class

    Hi ,

    I just realized that I posted this in a different Topic..

    I am a new biew to Spring.. I have a bunch of stored procedures around 30 in number. (This is just a simple proc call from java to a Stored procedure)

    And my requirement is to call these bunch of Stored Procs from a Generic class which I have to create using SPring or Spring and Hibernate.. Can you guys please help me.. I am not able to figure out how to do this.. I am really in a serious issue with this problem..Can you please send me the example code and also of how to start developing and from where to start... You can email me if any code @ [email protected]
    Your help is highly appreciated


  • #2
    Follow the GenericDAO pattern which can implement your DB operations in a centralized place not only for CRUD but also for executing Stored Procs and Functions.

    You can use Hibernate or any of the other JPA implementations like Open JPA etc.. for implementing your CRUD and Stored Proc calls for your Generic DAO api's.

    You can use Spring to wire your Generic DAO with your other service classes in your persistence layer which will call prepare the needed inputs for calling your stored procs and will also know which stored proc name has to be used, based on the calling business class invocation.
    Last edited by Shiv_S; Feb 25th, 2013, 05:31 PM.