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 -> Re: JDBC question: Execute procedure with plain SQL?

Re: JDBC question: Execute procedure with plain SQL?

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 29 Mar 2005 09:37:15 -0800
Message-ID: <1112117835.743751.77100@l41g2000cwc.googlegroups.com>

Joe Weinstein wrote:
> Hi all.
> I know that PreparedStatements are the correct means for
executing a stored procedure,
> but in my current case I am limited to a plain Statement object. Is
there a SQL string that
> would allow a plain statement to execute a simple non-parameterized
procedure? Eg:
>
> Statement s = con.createStatement();
> s.execute("execute myProcedureName" );
>
> This doesn't work like SQL-PLUS... The driver just sends the "execute
myProcedureName"
> to the DBMS and then it fails with a ORA-00900: invalid SQL
statement.
>
> Thanks,
> Joe Weinstein at BEA

Not according to java docs. You need to use PreparedStatement and CallableStatement for procedure calls.

Regards
/Rauf Received on Tue Mar 29 2005 - 11:37:15 CST

Original text of this message

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