• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring JDBCTemplate procedure

 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need to send a request via Spring JDBCTemplate to an Oracle Stored procedure,

the signature of the Oracle procedure is:

PROCEDURE METHOD_NAME (param0 VARCHAR2, param1 newType, param2 NUMBER(19,0) DEFAULT NULL, param3 DATE DEFAULT NULL, param4 VARCHAR2 DEFAULT NULL) AS

where newType is of type "AS TABLE OF number(19)"




what should the method for calling this stored procedure using Spring JDBCTemplate?



currently my code is:



Thanks in Advance,

Niall
 
Sheriff
Posts: 22716
129
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags next time.

I'll move this thread to our Spring forum.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look for a class called StoredProcedure from Spring. The constructor is used to setup the in and out parameter type and names, then the execute method is to assign values to the in parameters and to execute the stored procedure and take the out parameters returned.

Then you just instantiate the StoredProcedure implementation and call the execute method.

Here is the documentation
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/jdbc.html#jdbc-StoredProcedure

Or you can also do it this way

http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/jdbc.html#jdbc-simple-jdbc-call-1

Mark
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic