Announcement Announcement Module
Collapse
No announcement yet.
SqlOutParameter errors Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Which version of the Oracle JDBC driver are you using?

    Comment


    • #3
      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

      Comment


      • #4
        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.

        Comment

        Working...
        X