• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Returning JDBC resultset from Java stored proc

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic