Announcement Announcement Module
Collapse
No announcement yet.
Stored Procedure Parameters Problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stored Procedure Parameters Problem

    Hi,
    I run stored procedures defined in external sql files. The stored procedures are written in the form of
    call ABCD.proc(?, ?)

    Since the types and the numbers of parameters are defined in runtime, so I cannot figure out it in my code use declareParameter(name, type).

    I want to use the style of JdbcTemplate.queryForList(string, Object[]) instead of execute(Map), it looks like
    execute(string, Object[]). Any one knows how to do this? Thx!

  • #2
    You should have a look at the doc here :

    http://static.springframework.org/sp...toredProcedure

    Comment


    • #3
      PHP Code:

      private static void byStoredProcedure(JdbcTemplate jt2) {
              
      CallableStatementCallback cb = new CallableStatementCallback(){
                  public 
      Object doInCallableStatement(CallableStatement csthrows SQLExceptionDataAccessException {
                      
      cs.execute();
                      return 
      null;
                  }
                  
              };
              
              
      jt2.execute("{cdo_sp(?,?)}"cb);
              
          } 

      here i need to set the parameter, how can set the parameter?

      Comment


      • #4
        This appears to be a duplicate................
        http://forum.springframework.org/showthread.php?t=40890
        Last edited by karldmoore; Aug 29th, 2007, 12:13 PM.

        Comment

        Working...
        X