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: Joe Weinstein <joeNOSPAM_at_bea.com>
Date: Tue, 29 Mar 2005 09:55:22 -0800
Message-ID: <4249968A.3060601@bea.com>

D Rolfe wrote:

> Joe,
>

>> 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" );
>>

>
>
> try:
>
> Statement s = con.createStatement();
> s.execute("BEGIN myProcedureName; END;");

Much thanks. *That's* just what I needed. Joe

>
> Off the top of my head have no idea if this will work - we normally use
> CallableStatements.
>
> As a *truly desperate hack* you could always:
>
> 1. Create a table
> 2. Create a POST UPDATE trigger on the table that calls your procedure.
>
> David Rolfe
> Orinda Software
> Dublin, Ireland
>
> ------------------------------------------------------------------------
> Orinda Software makes OrindaBuild, a tool that generates Java source
> code to access Oracle databases.
>
> www.orindasoft.com
Received on Tue Mar 29 2005 - 11:55:22 CST

Original text of this message

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