agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] Pljava-dev Digest, Vol 26, Issue 8
Date: Wed, 19 Apr 2006 16:56:06 +0800
Message-ID: <20060419085615.E7DF3978C1@smtp.263.net> (raw)
pljava-dev-request,hi?
Marek's source code:
> // insert into regional registrations table
> {
> Statement s = connection.createStatement();
>
> ResultSet r = s.executeQuery("SELECT oCarTypeId FROM
>samarapp_data.sapp_cda_pl_cep_rre WHERE oCarTypeId = " + co + " AND
>nCarTypeId = " + cn + " AND nMakeId = " + mk + " AND nModelId = " + mo +
>" AND nDistrictW = " + rw + " AND nDistrictP = " + rp + " AND
>productionYear = " + result.getInt("productionyear") + " AND
>registrationYear = " + result.getInt("registrationyear"));
>
> if (r.next() == false) s.execute("INSERT INTO
>samarapp_data.sapp_cda_pl_cep_rre (oCarTypeId, nCarTypeId, nMakeId,
>nModelId, nDistrictW, nDistrictP, productionYear, registrationYear,
>registrationMonth" + result.getInt("registrationmonth") + ") VALUES (" +
>co + "," + cn + "," + mk + "," + mo + "," + rw + "," + rp + "," +
>result.getInt("productionyear") + "," +
>result.getInt("registrationyear") + "," +
>result.getInt("registrationamount") + ")");
>
> else s.execute("UPDATE samarapp_data.sapp_cda_pl_cep_rre SET
>registrationMonth" + result.getInt("registrationmonth") + "=" +
>result.getInt("registrationamount") + " WHERE oCarTypeId = " + co + "
>AND nCarTypeId = " + cn + " AND nMakeId = " + mk + " AND nModelId = " +
>mo + " AND nDistrictW = " + rw + " AND nDistrictP = " + rp + " AND
>productionYear = " + result.getInt("productionyear") + " AND
>registrationYear = " + result.getInt("registrationyear"));
>
> r.close();
>
> s.close();
> }
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.
????????lifeng
????????lifenggod at 263.net
??????????2006-04-19
view thread (2+ messages) latest in thread
Message-ID: <20060419085615.E7DF3978C1@smtp.263.net>
Permalink: ../20060419085615.E7DF3978C1@smtp.263.net/
Also on: postgresql.org/message-id/20060419085615.E7DF3978C1@smtp.263.net
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pljava-dev@postgresql.org
Subject: Re: [Pljava-dev] Pljava-dev Digest, Vol 26, Issue 8
In-Reply-To: <20060419085615.E7DF3978C1@smtp.263.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox