• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JRUN Oracle and Stored Procedures

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the Oracle forum, since it is not a Servlets question.

Mark
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic