aspose file tools*
The moose likes Oracle/OAS and the fly likes Returning JDBC resultset from Java stored proc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Returning JDBC resultset from Java stored proc" Watch "Returning JDBC resultset from Java stored proc" New topic
Author

Returning JDBC resultset from Java stored proc

John Sinues
Ranch Hand

Joined: Feb 21, 2000
Posts: 52
In the Oracle example found here, the author describes how one can return a resultset from a Java stored procedure. The example is pretty straightforward and easy to understand. My concern, however, is the Java stored procedure prone to leaks? Since, you are returning a resultset, you cannot explicitly close the database connection, statement, or resultset. However, closing these objects are recomended to prevent things such as cursor leaks. Does anyone know how Oracle 9i handles things such as this?

TIA,
- John
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29249
    
139

John,
It's important to close the connection/statement/resultset in Java (on an app server) because the JVM is bad at cleaning up resources. If you write a stored proc in PL/SQL, the database server cleans up after itself automatically. So I imagine a Java stored proc would work in a similar way. You could try it to make sure though.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Returning JDBC resultset from Java stored proc
 
Similar Threads
Multiple Result Sets
ORA-00942 How to figure out privileges problem
java stored procedure problems
How resultset is returned by stored procedure?
getting ResultSet from Java Stored Procedure