2 Replies Latest reply on Apr 11, 2003 6:43 AM by eddie07

    problem using oracle ref cursor

    eddie07

      Hi,
      I am trying to port an existing application to Jboss. I created an oracle connection according to the example oracle-service.xml, which works just fine. But when I am calling a stored procedure which is using a ref cursor an exception is thrown when I am trying to access this cursor with
      ResultSet rs = ((OracleCallableStatement)stmt).getCursor(9);
      The exception is:
      2003-04-10 17:47:44,571 INFO [STDOUT] Exception: org.jboss.resource.adapter.jdbc.local.LocalCallableStatement
      2003-04-10 17:47:44,573 INFO [STDOUT] java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.local.LocalCallableStatement
      2
      which is called by the statement above.

      Are there any known problems?

      Another small problem: To get my EJB running I had to change the string for JNDI lookup of the oracle connection. Is this normal?

      Eddie

        • 1. Re: problem using oracle ref cursor
          davidjencks

          to use non-jdbc methods you need to get the underlying connection or statement object.

          OracleConnection c = (OracleConnection)c.getUnderlyingConnection();

          There might be a getUnderlyingStatement method on the statement wrapper, I don't remember.

          • 2. Re: problem using oracle ref cursor
            eddie07

            Sounds interesting.
            Unfortunately I've not been able to find any documentation about getUnderlyingConnection().
            I assume it's part of Jboss.
            Where should I look for a description? And which jar file has to be added to CLASSPATH?
            (I just asked our library to order the Jboss documentation, so I should have this somewhere next week.)

            Thanks for your help,
            Eddie