Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: Re: Not closing connections and statements Date: Sat, 13 Aug 2016 12:50:07 +0200 Organization: Decebal Computing Lines: 13 Message-ID: <87popdj63k.fsf@Equus.decebal.nl> References: <87shuakxjq.fsf@Equus.decebal.nl> <87k2fllkjf.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="12baf5125b19322b899c79c2e3878015"; logging-data="24219"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cybobTViq/L4shTpwpim1Lpx8Oo/J36I=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:rtboS+ejs0d4AdeVLOC7AsVYwik= sha1:T60rJ2sbdt4MKAtmGbesmCza55Q= X-Homepage: http://www.decebal.nl/ Xref: csiph.com comp.lang.java.programmer:35302 On Saturday 13 Aug 2016 03:58 CEST, Arne Vajhøj wrote: > I would find it tempting to open the connection in main with a try > resource and pass the connection object to this method. But this is an utility function to be used by a lot of programs. I do not want to need to have to do more as: freeMemoryThread(this.getClass().getSimpleName()); -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof