[ Back | Previous | Next ]

How to make Oracle Stored Procedure calls (syntax)?

Package:
java.sql.*
Product:
JDK
Release:
1.0.2
Related Links:
General
General
General
General
CallableStatement
Comment:
  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;");
1