From: lifenggod at 263.net (lifeng) Date: Wed, 19 Apr 2006 16:56:06 +0800 Subject: [Pljava-dev] Pljava-dev Digest, Vol 26, Issue 8 Message-ID: <20060419085615.E7DF3978C1@smtp.263.net> 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