#623 named parameter not found for stored procedure


I retrieved all parameters of a stored procedure using connection.getMetaData().getProcedureColumns(...). the call returned a ResultSet of 12 rows, one for the return parameter @RETURN_VALUE, and 11 input/output parameters.
I then prepared a callable statement knowing the number of parameters to get the proper number of '?' in the querystring.
the query string looks like "{? = call anyProc (?,?,?,?,?,?,?,?,?,?,?)}"

Then I used these parameter names to populate the statement. This failed for the last known parameter, because it could not find a parameter with the given name in the parameter list of the callable statement.

Debugging the test showed that the last parameter element of the callable statement's parameter list had the name of the second last parameter of the stored procedure.
Scanning through all elements of the parameter list I found that the callable statement had added another return value parameter as the second parameter of the callable statement's parameter list. The total number of parameters seems either one too few or the parameter has been added by mistake.

Using jtds-1.2.5 against SQL Server 2008


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks