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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Can I call PL/SQL from java using Oracle's JDBCThin client ? .... I am on and SGI and there is no JDBC OCI interface .... what can I do ?

Re: Can I call PL/SQL from java using Oracle's JDBCThin client ? .... I am on and SGI and there is no JDBC OCI interface .... what can I do ?

From: Kim Do-Hyung <dynaxis_at_compiler.kaist.ac.kr>
Date: 1997/12/31
Message-ID: <68e44f$5qq$1@usenet.kreonet.re.kr>#1/1

In comp.lang.java.databases Hank Griffioen <hank_at_daac.gsfc.nasa.gov> wrote:
: Does anyone know if I can call a stored procedure from the Oracle thin JDBC
: interface ?
 

: [snipped]
 

: CallableStatement statement;
: statement = conn.prepareCall("call select_person[(?,?,?)]}");

Haven't you read the html file included in the driver distribution? Excerpted from it:

  STORED PROCEDURES    Oracle JDBC drivers support execution of PL/SQL stored procedures and    anonymous blocks. They support both SQL92 escape syntax and Oracle    escape syntax. The following PL/SQL calls are all available from any    Oracle JDBC driver:

   SQL92 Syntax

   CallableStatement cs1 = conn.prepareCall("{call proc (?,?)}") ;    CallableStatement cs2 = conn.prepareCall("{? = call func (?,?)}") ;

   Oracle Syntax

   CallableStatement cs3 = conn.prepareCall("begin proc (:1, :2); end;") ;    CallableStatement cs4 = conn.prepareCall("begin :1 := func(:2,:3); end;");


The DBMS independent use of selective trasitional level semantics requires use of escape syntax({...}), nevertheless you didn't. JavaSoft recommends the use of escape syntax over DBMS specific syntax for DBMS independancy.

Hope this helps.

: [also snipped]
Received on Wed Dec 31 1997 - 00:00:00 CST

Original text of this message

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