DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12888>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12888

[jelly] JDBC sql result set leak





------- Additional Comments From [EMAIL PROTECTED]  2002-09-27 17:49 -------
Just a comment on the last comment :)

In JDBC 3 closing the connection will close the statement to be closed
automatically, and closing the statemeent will cause the ResultSet to close
automatically. However in JDBC 2 this is not the case. Closing the connection
will close the statement, but closing the stamtement is not guaranteed to close
the ResultSet (a mistake in the spec methinks). But many JDBC 2 drivers do close
the ResultSet if the statement is closed. That's why you should always close the
ResultSet first and then the Statement.

BTW your code wasn't quite right, bit resultset.close and statement.close throw
exceptions, these either need to be caught or re-thrown. The catch handlers for
these typically do nothing (what can you do at this point?)

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to