File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Call stored procedure with Spring

 
Bruce Jin
Ranch Hand
Posts: 672
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a stored procedure with 1 parameter (INOUT DECIMAL).
My class extends Spring framework StoredProcedure class. It errors at line:

Map outParams = execute(inParams);

java.sql.SQLException: The number of parameter values set or registered does not match the number of parameters.

The code is as follows:

 
Bruce Jin
Ranch Hand
Posts: 672
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found out it must be:

declareParameter(new SqlOutParameter("P1", Types.DECIMAL));

instead of:

declareParameter(new SqlParameter("P1", Types.DECIMAL));
 
Darvesh Niz
Ranch Hand
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Blatant advertisin not allowed in this forum, and please don't resurrect months old threads. - Mark Spritzler)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic