aspose file tools*
The moose likes Oracle/OAS and the fly likes JRUN Oracle and Stored Procedures Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "JRUN Oracle and Stored Procedures" Watch "JRUN Oracle and Stored Procedures" New topic
Author

JRUN Oracle and Stored Procedures

J Fideler
Greenhorn

Joined: May 24, 2004
Posts: 1
I cannot find a single example in nature of an Oracle Stored Procedure that returns a set of results (i.e. select * from user) along with the java code that would read that set of results through a jdbc connection pool

Why is this such an obscure thing?? In the SQL Server world this is the normal way to do things and there are examples galore (simple ones!!)

What gives here? Or are stored procs simply not done in Oracle?

Please Help
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Ref Cursor

Getting a connection from a pool is the same for Oracle, MySQL, M$Sql etc. The only difference is the configuration of the pool to specify the DriverManager class.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Moving this to the Oracle forum, since it is not a Servlets question.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Oracle and SQL Servers stored procedures work differently. In most cases SQL Server stored procedures are really just stored queries. Whereas in Oracle a stored procedure is actually a procedure of code. Meaning you can do many things, not necessarily getting data. Although in that case why make it a stored procedure on the back-end when you can move that type of code closer to where it is needed.

In Oracle to get a Result set back, you have to actually pass an empty result set to the procedure as an IN/OUT parameter. That is waht is called a ref cursor, or reference cursor.

Good Luck.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JRUN Oracle and Stored Procedures