Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / March 2007

Tip: Looking for answers? Try searching our database.

JDBC - Oracle - Procedure/Fonction

Thread view: 
bouchia.nazha@free.fr - 20 Mar 2007 16:53 GMT
Hello

It's possible via JDBC to execute function like this or to execute sql
script:

begin
for dd in (
SELECT  id idf
FROM ma_table
WHERE etat= 'A' )
loop
UPDATE ma_table
SET etat = 'T',
WHERE id = dd.idf;
end loop;
commit;
end;

Thanks
David Harper - 20 Mar 2007 21:07 GMT
> Hello
>
[quoted text clipped - 13 lines]
> commit;
> end;

1. Define a stored procedure in your schema using SQL.  You need to do
   this only once. Consult a good Oracle book to learn how to define
   stored procedures.

2. In your Java code, create a CallableStatement object using
   Connection.prepareCall.

3. Set the parameters of the CallableStatement.

4. Execute the CallableStatement.

5. Fetch the results, if any.

David Harper
Cambridge, England


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.