From: marek at lewczuk.com (Marek Lewczuk) Date: Wed, 19 Apr 2006 11:24:54 +0200 Subject: [Pljava-dev] [SPAM] Re: Pljava\-dev Digest, Vol 26, Issue 8 In-Reply-To: <20060419085728.5BBB4978E7@smtp.263.net> References: <20060419085728.5BBB4978E7@smtp.263.net> Message-ID: <444601E6.2060103@lewczuk.com> lifeng napisa?(a): > pljava-dev-request,hi? > When did the result close ? Marek, we can see > two ResultSet("result" and "r")in your sourcecode .In the last code , >there is "r.close" to close ResultSet("r") explicitly but i cann't see where > the "result" is closed . If you did not close the "result", i guess that it's the > error to lead the memory leak. Well, result is a ResultSet of the main query: Connection connection = DriverManager.getConnection("jdbc:default:connection"); Statement statement = connection.createStatement(); ResultSet result; statement.execute("..."); result = statement.getResultSet(); while (result.next()) { ... } result.close(); statement.close(); So as you can see it will be closed after last row.