• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Call stored procedure with Spring

 
Bruce Jin
Ranch Hand
Posts: 672
  • 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
  • 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
  • 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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic