• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Returning JDBC resultset from Java stored proc

 
John Sinues
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 33719
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic