Jan 10th, 2013, 01:47 PM
Call Stored Procedures from a generic class
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 @ firstname.lastname@example.org
Your help is highly appreciated
Feb 24th, 2013, 10:05 PM
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 at 05:31 PM.