Thursday 28 February 2013

calling procedure in Controller



      if (paramOAPageContext.getParameter("submit_button_id") != null)
      {
        OAApplicationModule localOAApplicationModule2 = paramOAPageContext.getApplicationModule(paramOAWebBean);
         localNumber = null;
         try {
           localNumber = new Number(paramOAPageContext.getDecryptedParameter("ReportHeaderId"));
         }
         catch (SQLException localSQLException2)
         {
         }
       
         if (localNumber != null)
         {
         OADBTransactionImpl  dbtrx =   (OADBTransactionImpl)localOAApplicationModule2.getOADBTransaction();
         String message_out = null;
          String str = "BEGIN xx_custom_pkg.xx_proc( p_report_header_id => :1 , p_message => :2 );END; ";
          CallableStatement localCallableStatement = dbtrx.createCallableStatement(str, 1);
          try
          {
            localCallableStatement.setInt(1, localNumber.intValue());
            localCallableStatement.registerOutParameter(2, Types.VARCHAR);
            localCallableStatement.execute();
            message_out = localCallableStatement.getString(2);
          }
          catch (SQLException localException2)
          {
              paramOAPageContext.writeDiagnostics(this,"abhishek > catch "+localException2,6);
          }
       
         }
}

No comments:

Post a Comment