aspose file tools*
The moose likes Spring and the fly likes Error using Spring to call Oracle stored procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Error using Spring to call Oracle stored procedure" Watch "Error using Spring to call Oracle stored procedure" New topic
Author

Error using Spring to call Oracle stored procedure

J Miller
Ranch Hand

Joined: Oct 21, 2010
Posts: 67
We're using the spring framework to call an Oracle stored procedure, and it's giving me an error saying "wrong number or types of arguments in call". Here's what my dao looks like:




The spec for my stored procedure is:



So my stored proc has 1 input, and 1 output parameters. I'm only passing in a single input parameter, so I'm not sure why I'm getting that error. Any ideas?
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

I think you need to declare all parameters, IN,INOUT or OUT

WP
J Miller
Ranch Hand

Joined: Oct 21, 2010
Posts: 67
I've updated the CriteriaStoredProcedure method to include the in parameter, and it doesn't seem to have made a difference. Still getting the same error. The only thing I can think of is that the datatype of the input param in Oracle is VARCHAR2, but there's no type for that under oracle.jdbc.OracleTypes.


J Miller
Ranch Hand

Joined: Oct 21, 2010
Posts: 67
Found the problem. In my retrieveCriteria method, I had the name of the output cursor wrong. In Oracle it's "out_cursor", in that method I named it "output_cursor". Simple mistake.
 
 
subject: Error using Spring to call Oracle stored procedure