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 / September 2003

Tip: Looking for answers? Try searching our database.

PL/SQL in Oracle 8i

Thread view: 
Ole - 19 Sep 2003 12:13 GMT
Hallo,

I want execute a procedure from Java but the procedure is very long so it
doesn't goes like this:

..Statement s = c.createStatement();
String sproc = "CREATE OR REPLACE PROCEDURE XYZ......");

The Procedure is known by the Database, but how can I execute it from Java?

Thanks in advance.

Ole
Ralf Bensmann - 19 Sep 2003 19:57 GMT
> Hallo,
>
[quoted text clipped - 9 lines]
>
> Ole

Use java.sql.CallableStatement. It is similar to using a prepared
Statement. Example:

// storec proc. xyz with three params
CallableStatement cstmt = conn.prepareCall("{call xyz(?, ?, ?)}");

// set params, like used in a prepared statement
cstmt.setInt(1, 100);
cstmt.setInt(2, 250);
cstmt.setString(3, "hello");

// execute the procedure
cstmt.execute();

Greetings

Ralf.
Andree Große - 23 Sep 2003 12:39 GMT
>> Hallo,
>>
[quoted text clipped - 9 lines]
> // storec proc. xyz with three params
> CallableStatement cstmt = conn.prepareCall("{call xyz(?, ?, ?)}");

A stored procedure to cerate a stored procedure?
That's very interesting. He want to perform a
PL/SQL Script.
A.G.
Andree Große - 23 Sep 2003 12:42 GMT
> Hallo,
>
[quoted text clipped - 5 lines]
>
> The Procedure is known by the Database, but how can I execute it from Java?

Why do you think that does not work?
A.G.


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.