AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PL/SQL in Oracle 8i

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
Ole
Guest





PostPosted: Fri Sep 19, 2003 11:13 am    Post subject: PL/SQL in Oracle 8i Reply with quote



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



Back to top
Ralf Bensmann
Guest





PostPosted: Fri Sep 19, 2003 6:57 pm    Post subject: Re: PL/SQL in Oracle 8i Reply with quote



Ole wrote:

Quote:
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

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.


Back to top
Andree Große
Guest





PostPosted: Tue Sep 23, 2003 11:39 am    Post subject: Re: PL/SQL in Oracle 8i Reply with quote



Ralf Bensmann wrote:
Quote:
Ole wrote:

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

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(?, ?, ?)}");

A stored procedure to cerate a stored procedure?
That's very interesting. He want to perform a
PL/SQL Script.
A.G.



Back to top
Andree Große
Guest





PostPosted: Tue Sep 23, 2003 11:42 am    Post subject: Re: PL/SQL in Oracle 8i Reply with quote

Ole wrote:
Quote:
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?

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



Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.