Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring JDBCTemplate procedure

 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • 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: 21974
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags next time.

I'll move this thread to our Spring forum.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • 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
 
What's gotten into you? Could it be this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic