Announcement Announcement Module
No announcement yet.
SqlOutParameter errors Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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:

    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));
       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??


  • #2
    Which version of the Oracle JDBC driver are you using?


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

      Since I'm attached to a 10.2 database I've upgraded to the 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 version against a database, for example?



      • #4
        Your problem was due to a bug in the driver - see

        Your driver should work fine with a database but I would upgrade to the latest 10.2 driver available which I think is