1 Reply Latest reply on Aug 31, 2001 4:18 PM by John Muhlestein

    cannot execute a database function from bean

    John Muhlestein Newbie

      On JBoss 2.2.2 I am attempting to execute a function in my database and I am getting an unexpected exception.

      com.ilink.adminejb.WhlslVendorException: Cannot add new vendor - CallableStatement:: This function is not supported
       at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
       at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
       at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
       at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown Source)
       at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:188)
       at $Proxy1.addWhlslVendor(Unknown Source)
       at john.testing.EJBTestClient.makeCall(EJBTestClient.java:49)
       at john.testing.EJBTestClient.main(EJBTestClient.java:63)

      The place where the code is failing is

       DataSource ds = (DataSource)jndiContext.lookup("java:comp/env/jdbc/vndDB");
       Connection conn = ds.getConnection();
       CallableStatement cstmt = conn.prepareCall(" { ? = whlsl_admin_pub.createWhlslVnd(?,?,?,?,?,?,?,?) } ");
       ** cstmt.registerOutParameter(1, Types.INTEGER); **

      at the point where I try to register the return value(**)
      Are there limitations to executing CallableStatements or am I just missing something obvious?