title: How to get results of an stored procedure using SimpleJDBCCall in spring with two result table?
body: <p>I'm implementing a Spring+ MSSQL Server 2008 application. I use SimpleJDBCCall API to execute stored procedures and retrieve results.</p>
  
  <p>For stored procedures with mono table results, it works fine, but I don't know how to use it for procedures with multi table results.
  here is the screenshot from query of my database that returns two result table.<a href="http://i.stack.imgur.com/12JnI.jpg" rel="nofollow">1</a></p>
  
  <p>here is the code that i use,this code work properly with single table result`</p>
  
  <pre><code>public class LoadOnDemandSP extends StoredProcedure{
      private static final String SPROC_NAME = "sps_IME_EF_GetAllMarketData";
  
      public LoadOnDemandSP(DataSource ds) {
          super(ds, SPROC_NAME);
  
          RowMapper mapper = new MyRowMapper();
          declareParameter(new SqlReturnResultSet("Return Value", mapper));
          declareParameter(new SqlParameter("FromDate", Types.VARCHAR));
          declareParameter(new SqlParameter("ToDate",Types.VARCHAR));
          compile();
  
      }
  
      public List execute(String FromDate,String ToDate) {
          Map inputs = new HashMap();
          inputs.put("FromDate",FromDate);
          inputs.put("ToDate",ToDate);
          Map map = super.execute(inputs);
          if (map != null &amp;&amp; map.size() &gt; 0) {
              return (List) map.get("Return Value");
          } else {
              return new ArrayList();
          }
  
  
      }
  
  
      private class MyRowMapper implements RowMapper&lt;LoadOnDemand&gt; {
          public LoadOnDemand mapRow(ResultSet rs, int rowNum) throws SQLException {
              LoadOnDemand l = new LoadOnDemand();
  //              f.setDay(rs.getInt("ContractDay"));
              l.setInternalQuantity(rs.getInt("DVaznTon"));
              l.setExportalQuantitiy(rs.getInt("SVaznTon"));
              l.setInternalValue(rs.getDouble("DArzeshMillion"));
              l.setExternalValue(rs.getDouble("SArzeshMillion"));
              l.setInternalBuyersCount(rs.getInt("DBuyers"));
              l.setExternalBuyersCount(rs.getInt("SBuyers"));
              l.setInternalSellersCount(rs.getInt("DSellers"));
              l.setExternalSellersCount(rs.getInt("SSellers"));
              l.setInternalGoodsCount(rs.getInt("DSymbols"));
              l.setExternalGoodsCount(rs.getInt("SSymbols"));
              l.setTablo(rs.getString("GrouhAsli"));
              return l;
          }
      }
  
  
  
  }
  </code></pre>
  
  <p>///Added////</p>
  
  <p>My sample SP:</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[sps_Test1]
  
  WITH RECOMPILE      
  AS
  
  SELECT *
  
  FROM dbo.tbl1
  
  SELECT *
  
  FROM dbo.tbl2
  </code></pre>