Announcement Announcement Module
Collapse
No announcement yet.
junit stop at execution part of stored procedure. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • junit stop at execution part of stored procedure.

    hi all,

    we are performing unit test on stored procedure from oracle on java. but the testing always hangs at execute function. any example on that part.?

    PHP Code:
    GetOpenCloseList tmp = new GetOpenCloseList(getDataSource());
            
    System.out.println("-----------Execution-----------");
            
    Map map1 tmp.execute("TEST"); //<---hang at here
                                
    if (map1.size() >) {
                
    String tmpStr = (String)map1.get("poa_retcode");
                
    System.out.println("Return String:"+tmpStr);
            } 
    PHP Code:
    public class GetOpenCloseList extends StoredProcedure {
        
        private static final 
    Log log LogFactory.getLog(GetOpenCloseList.class);

        private static final 
    String STORED_PROC_NAME "ass_sc_001_pkg.p_get_display_list";
        
        
    ResultsetMapper em = new ResultsetMapper();
        
        public 
    GetOpenCloseList(DataSource ds) {
            
    super(dsSTORED_PROC_NAME);

            
    declareParameter(new SqlParameter("piv_primary_book"Types.VARCHAR));
            
    declareParameter(new SqlParameter("pin_page_number"Types.INTEGER));
            
    declareParameter(new SqlParameter("pin_row_page"Types.INTEGER));
            
    declareParameter(new SqlOutParameter("pon_total_row"Types.INTEGER));
            
    declareParameter(new SqlOutParameter("poa_result"oracle.jdbc.OracleTypes.CURSORem));
            
    declareParameter(new SqlOutParameter("pon_retcode"Types.INTEGER));
            
    declareParameter(new SqlOutParameter("pov_errbuf"Types.VARCHAR));
            
    //declareParameter(new SqlOutParameter("pa_error", oracle.jdbc.OracleTypes.CURSOR, em));
            //declareParameters();
    //        declareOutParameters();
            
    compile();
        }

        public 
    Map execute(String userId) {
            
    Map inParams = new HashMap(3);
            
    inParams.put("piv_primary_book""CB");
            
    inParams.put("pin_page_number"1);
            
    inParams.put("pin_row_page"2);

            
    Map outParams execute(inParams);
            
    log.info("poa_retcode:"+outParams);
            
    log.info("poa_retcode size:"+outParams.size());
            if (
    outParams.size() > 0) {
                
                
    ArrayList result2 em.getResult();
                
    outParams.put("poa_result"result2);
                
                return 
    outParams;
            } else {
                return 
    null;
            }
        }

    any ideas on this problem?

  • #2
    After added log4j.xml to print out debug message. I figured out the problem. it is a bug oracle jdbc which bundled in jboss server 4.03 sp2

    Use the new driver. the problem is resolved.

    http://forum.springsource.org/showth...le-stored-proc

    Comment

    Working...
    X