Results 1 to 4 of 4

Thread: Stored Procedure Parameters Problem

  1. #1
    Join Date
    Oct 2006
    Posts
    9

    Default 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. #2

    Default

    You should have a look at the doc here :

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

  3. #3
    Join Date
    May 2007
    Posts
    104

    Default

    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?

  4. #4
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    This appears to be a duplicate................
    http://forum.springframework.org/showthread.php?t=40890
    Last edited by karldmoore; Aug 29th, 2007 at 11:13 AM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •