Path: csiph.com!news.redatomik.org!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: Not closing a SQL(ite3) connection Date: Sat, 12 Aug 2017 21:45:48 -0400 Organization: Aioe.org NNTP Server Lines: 32 Message-ID: References: <87a839um2q.fsf@munus.decebal.nl> <874lte1pdj.fsf@munus.decebal.nl> <87bmnlyrx7.fsf@munus.decebal.nl> <87y3qoyhei.fsf@munus.decebal.nl> NNTP-Posting-Host: PBuS014lhzVyHjLbXmo/ZQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:37158 On 8/12/2017 10:44 AM, Cecil Westerhof wrote: > Arne Vajhøj writes: >> I see little value in this over the much more simple: >> >> @Override >> public void close() throws SQLException { >> Statement stmt = resultSet.getStatement(); >> resultSet.close(); >> stmt.close(); >> } >> >> :-) >> >> The original SQLException should contain sufficient information. I >> don't see "Could not close Statement after closing ResultSet." adding >> value. > > Maybe I am gold-plating. I want to make sure that it is clear that it > is my function and not a user function where it goes wrong, but > of-course: > nl.decebal.sql.SQLResultSet.close > makes that clear. > > I probably should remove it. Maybe try some error situations and see how good an exception text you get with the simple code (note that you may need to use both stack trace and nested exceptions to get all available info). Arne