Announcement Announcement Module
Collapse
No announcement yet.
how to call stored procedure in spring and the result set should be Map object Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to call stored procedure in spring and the result set should be Map object

    Hi friends,

    can anyone help me on these, i am trying to calling a stored procedure, it should be the resultset in the form of Map object. For these i used spring jdbc concept but i am getting a error like BadSqlGrammerException.

    dao classes method.

    public Map getClassificationView(String sUser,String sLocation,String sPattern, String sCurrPage){
    LOG.info(">>>>>>>>>>>METHOD NAME getClassificationView Starts in Classification DAO>>>>>>>>>>>>>");
    ProcedureAndFunctions stproc = new ProcedureAndFunctions();
    stproc.setJdbcTemplate(getJdbcTemplate());
    stproc.setSql("DF_Get_classification_view");

    stproc.declareParameter(new SqlOutParameter(sLocation,Types.VARCHAR));
    stproc.declareParameter(new SqlOutParameter("null", Types.VARCHAR));
    stproc.declareParameter(new SqlOutParameter(sCurrPage, Types.INTEGER));
    stproc.declareParameter(new SqlOutParameter("Y", Types.VARCHAR));
    stproc.compile();
    Map results = stproc.execute();
    for (Iterator it = results.keySet().iterator(); it.hasNext()
    {
    System.out.println(results.get(it.next()));
    }

    LOG.info(">>>>>>>>>>>METHOD NAME getClassificationView Ends in Classification DAO>>>>>>>>>>>>>");
    return results;
    }

    ProcedureAndFunctions.java:

    public class ProcedureAndFunctions extends StoredProcedure
    {
    public ProcedureAndFunctions()
    {
    }

    public Map execute()
    {

    Map inputs = new HashMap<String,Object>();
    return super.execute(inputs);



    }
Working...
X