I am a new biew to Spring.. I have a bunch of stored procedures around 30-40 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...
Your help is highly appreciated
All I can recommend is reading what is in the Spring Framework documentation under Jdbc and Stored Procedure.
Basically in Spring Jdbc you can write a class that extends StoredProcedure. In the constructor you tell it what are the In and Out parameters. In the execute method you override you set those IN parameters and OUT parameters.
I have no example code except what you would find in the documentation.
Thanks alot for the prompt reply.. I am able to comeup with a part of the code extending Stored Procedures , but my question here is how am I able to pass the parameters and how am I able to pull the stored procedures is my question..??? I am not sure what else need to added or whats the issue with the code or if I am missing something in the code and wt other classes I need to develop.. Can you please help me to sort out this issue.
First, we have CODE tags that help keep posted code formatted with indentation so it is easier to read.
1) I thought in the constructor when you add a parameter you have to tell it whether it is an IN or OUT parameter, but I could be wrong. I haven't ever used StoredProcedure class because I avoid having any stored procedures anywhere in any application.
As far as now using it, I think you would have code in your DAO that uses it. Maybe with JdbcTemplate?
Again, I recommend going to the Spring Framework documentation and look at their example there.