Subject Closing ResultSet
Author Juan Pedro López Sáez
Hello everybody,

I have a java bean's method which makes a SQL query by means of a
PreparedStatement and gets the results in a ResultSet. After that, in a
finally block, I close the PreparedStatement.

I would like this method to return the ResultSet so that I can handle it
in another java bean. The problem is the ResultSet is automatically
closed when I close the PreparedStatement.

I know this is JDBC conformant, so my question is: is there any
convenient and maybe standard way to achieve my goals?

Just a little additional comment. I have recently modified my code to
use connection pooling with DBCP in Tomcat. Before the code
modification, I could close the PreparedStement and keep using the
ResultSet, as I want to do now. Does Anybody know why?

Thank you in advance.

Juan Pedro Lopez
Juan Pedro López Sáez