Results 1 to 4 of 4

Thread: SqlOutParameter errors

  1. #1
    Join Date
    Jun 2008
    Posts
    2

    Default SqlOutParameter errors

    I'm attempting to access an Oracle 10g stored procedure though Spring2.5 running on Tomcat 6.

    I've created a subclass of StoredProcedure:

    Code:
    private static class MyProc extends StoredProcedure {
       public MyProc(JdbcTemplate t) {
          super(t, "proc_name");
          declareParameter(new SqlParameter("inparam", OracleTypes.VARCHAR));
          declareParameter(new SqlOutParameter("outparam", OracleTypes.DECIMAL));
          compile();
       }
    
       public int execProc(String inValue) {
          int myInt = -1;
          Map params = new HashMap();
          params.put("inparam", inValue);
    
          Map outParams = execute(params);
    
          if (outParams.size()>0) {
             myInt = Integer.parseInt(outParams.get("outparam").toString());
          }
          return myInt;
       }
    }
    Unfortunately, each time I call the stored procedure my catalina.log fills with

    25-Jun-2008 13:44:41 org.springframework.jdbc.core.JdbcTemplate extractReturnedResults
    INFO: Added default SqlReturnUpdateCount parameter named #update-count-xxxx

    where xxxx is an increasing int. This line is generated at the 'execute' statement and repeats until I shutdown tomcat. The stored procedure does not seem to have executed (or has rolled back).

    The documentation for running stored procedures with out parameters doesn't seem to go much beyond the api.
    Could some point out the obvious newbie error I'm making??

    Cheers,
    B

  2. #2
    Join Date
    Aug 2004
    Posts
    1,110

    Default

    Which version of the Oracle JDBC driver are you using?
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  3. #3
    Join Date
    Jun 2008
    Posts
    2

    Default

    Looking at the manifest for the jar I was using, it looks like it was the ojdbc14.jar for 10.1.0.2.0 (Jan/21/2004).

    Since I'm attached to a 10.2 database I've upgraded to the 10.2.0.1 version and this seems to have fixed the problem, thanks.

    Does anyone know how much variation there is between the successive builds of this jar? Can I use the 10.2.0.1 version against a 10.2.0.2 database, for example?

    Cheers,
    B

  4. #4
    Join Date
    Aug 2004
    Posts
    1,110

    Default

    Your problem was due to a bug in the 10.1.0.2 driver - see http://forum.springframework.org/sho...28&postcount=5

    Your 10.2.0.1 driver should work fine with a 10.2.0.2 database but I would upgrade to the latest 10.2 driver available which I think is 10.2.0.4.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

Tags for this Thread

Posting Permissions

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