Results 1 to 5 of 5

Thread: Spring failed to count the correct number of parameters

  1. #1
    Join Date
    Jan 2005
    Posts
    2

    Default Spring failed to count the correct number of parameters

    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:

  2. #2
    Join Date
    Jan 2005
    Posts
    2

    Default

    Could any Spring DAO people take a look on this issue?
    Thanks.

  3. #3
    Join Date
    Aug 2004
    Posts
    1,110

    Default

    I'll try to look into this - problem is i don't have a Sybase database up and running right now. I'll keep you posted.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  4. #4
    Join Date
    Mar 2005
    Posts
    3

    Default Spring failed to count the correct number of parameters

    Hi,

    I am getting similar problem.

    I have a simple stored procedure GetDestinationList which takes no parameter and retruns a resultset and a return value.

    I have declared my parameters as follows and it gives similar problem as you are getting:

    declareParameter(new SqlReturnResultSet("rs", ExtractResultSet);
    declareParameter(new SqlOutParameter("RETURN", Types.NUMERIC));

    where ExtractResultSet implements ResultSetExtractor.

    Would you pls advise how you have resolved this problem ?

    Thanks,
    ajaya

  5. #5
    Join Date
    Aug 2004
    Posts
    1,110

    Default

    Turned out it did not have anything to do with Sybase - we just did not count the parameters correctly for a function returning multiple resultsets. I have fixed this and it will be part of 1.2RC1 due out next week.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  3. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM
  4. Spring code remarks
    By Alarmnummer in forum Architecture
    Replies: 18
    Last Post: Apr 7th, 2005, 07:17 AM
  5. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •