From: | marek at lewczuk(dot)com (Marek Lewczuk) |
---|---|
To: | |
Subject: | [Pljava-dev] [SPAM] Re: Pljava\-dev Digest, Vol 26, Issue 8 |
Date: | 2006-04-19 09:24:54 |
Message-ID: | 444601E6.2060103@lewczuk.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pljava-dev |
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.
From | Date | Subject | |
---|---|---|---|
Next Message | Marek Lewczuk | 2006-04-20 05:59:38 | [Pljava-dev] [SPAM] =\?utf\-8\?B\?UmU6IFJlOiBbU1BBTV0gUmU6IFBsamF2YVwtZGV2IERpZ2VzdCwgVm9sIDI2LCBJc3N1ZSA4\?= |
Previous Message | lifeng | 2006-04-19 08:56:06 | [Pljava-dev] Pljava-dev Digest, Vol 26, Issue 8 |