It seems there is bug in Spring that it miss count the number of parameters. Spring seems expecting 5 parameters (in my case) which is wrong, it shall be 4 parameters.
My store procedure takes 2 inputs and 1 output and it return an integer error code, something likes "OUT = prc_fmw_get_cont_from_ssn (IN, IN, OUT)".
In my code, I call "setFunction(true)". I call declareParameter() 4 times. First one is for return code, and the 2nd, 3th are for input, and 4th is for output (error message).
Anybody out there had experience with similar issue.
We are using Sybase database, and the stored procedure return 2 resultsetS, and 1 error code and 1 error message.
Thanks.
Here is my code:
//------
protected ContractsFromSsnProc(DataSource ds) {
setDataSource(ds);
setFunction(true);
setSql("prc_fmw_get_cont_from_ssn");
declareParameter(new SqlReturnResultSet("contractResultSet", this));
declareParameter(new SqlReturnResultSet("roleResultSet", this));
declareParameter(new SqlOutParameter("returnCode", java.sql.Types.INTEGER));
declareParameter(new SqlParameter("ssn", java.sql.Types.VARCHAR));
declareParameter(new SqlParameter("policyStatusMaskname", java.sql.Types.VARCHAR));
declareParameter(new SqlOutParameter("errorMessage", java.sql.Types.VARCHAR));
compile();
}
// -------- here is the error that I encountered
[1/27/05 10:38:21:200 EST] 6b6340b9 ContractsFrom I com.fili.bizsrv.lifecad.dataaccess.ContractsFromSs nProc Compiled stored procedure. Call string is [{? = call prc_fmw_get_cont_from_ssn(?, ?, ?, ?)}]
[1/27/05 10:38:21:763 EST] 6b6340b9 WebServicesSe E com.ibm.ws.webservices.engine.transport.http.WebSe rvicesServlet WSWS3227E: Error: Exception:
[1/27/05 10:38:21:778 EST] 6b6340b9 WebServicesSe E com.ibm.ws.webservices.engine.transport.http.WebSe rvicesServlet TRAS0014I: The following exception was logged WebServicesFault
faultCode: Server.generalException
faultString: org.springframework.jdbc.UncategorizedSQLException : (executing CallableStatementCallback [CallableStatementCreatorFactory.CallableStatementC reatorImpl: sql=[{? = call prc_fmw_get_cont_from_ssn(?, ?, ?, ?)}]: params=[{ssn=383000350, policyStatusMaskname= }]]): encountered SQLException [JZ0SA: Prepared Statement: Input parameter not set, index: 4.]; nested exception is java.sql.SQLException: JZ0SA: Prepared Statement: Input parameter not set, index: 4.
faultActor: null
faultDetail:


Reply With Quote