Hi all,

I am calling a stored procedure that takes two IN parameters and one OUT parameter. When I execute it by using spring storedprocedure class, I only see the return value but the value of OUT parameter. But the same stored procedure call thru direct jdbc api works fine by returning the value of the OUT param.

Here is the code that uses Spring API:
Code:
    class MyStoredProcedure extends StoredProcedure
    {
        private static final String PROC_NAME = "StoredProc";


        public MyStoredProcedure( DataSource dataSource )
        {
            setDataSource( dataSource );
            setSql( PROC_NAME );
            
            declareParameter( new SqlParameter( "name", Types.VARCHAR ) );
            declareParameter( new SqlParameter( "number", Types.VARCHAR ) );
            declareParameter(new SqlOutParameter("details", Types.VARCHAR));

            compile();
        }

        public Map<String, Object> executeProc( String name, String number )
        {
            Map<String, Object> inputMap = new HashMap<String, Object>();
            inputMap.put( "name", name );
            inputMap.put( "number", number);
                       
            return execute( inputMap );
        }
    }


MyStoredProcedure storedProc = new MyStoredProcedure( jdbcTemplate.getDataSource() );
        Map<String, Object> resultMap = storedProc.executeProc( name, number );
        
        Set entries = resultMap.entrySet();
        Iterator it = entries.iterator();
        String result = null;
        while (it.hasNext()) {
          Map.Entry entry = (Map.Entry) it.next();
          System.out.println("Key is -"+entry.getKey()+";"+Value is -"+entry.getValue());
          
          
        }
The output from above println is
Code:
Key is - update-count-1; Value is - 0
I would expect the OUT parameter "details" also as part of the resultMap.

What am I missing in this approach?

Any help is highly appreciated as I need to make use of the Spring approach.

Best regards.