Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> JDBC Stored Procedure difficulty

JDBC Stored Procedure difficulty

From: <nealgran_at_my-deja.com>
Date: Tue, 22 Jun 1999 19:52:26 GMT
Message-ID: <7kophm$ibf$1@nnrp1.deja.com>


I am writing a java application which needs to access either Oracle, or SQLServer DBMS. I have type 4 drivers for each, and I have succesfully writen JDBC code to execute general queries using preparedStatements. However to access a Stored Procedure I believe I need to use a callableStatement.

The problem is that I can access the SQLServer Stored procedure using the syntax:

        CallableStatement cstmt  = con.prepareCall("PutWJ");
        cstmt .execute();

where con is an established database connection, and PutWJ is the (parameterless) stored procedure set up in the SQLServer.

The same syntax does not work for an oracle 8 server on which PutWJ was also established. The error returned was: 'ORA-00900: invalid SQL statement'. I tried various tweeks of the syntax such as :

        CallableStatement cstmt = con.prepareCall("Call PutWJ"); but had no success.

If anyone could shed some light on my troubles I would appreciate it

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Tue Jun 22 1999 - 14:52:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US