X-Received: by 2002:ac8:33d9:: with SMTP id d25mr780910qtb.49.1551387099826; Thu, 28 Feb 2019 12:51:39 -0800 (PST) X-Received: by 2002:a25:a30a:: with SMTP id d10mr1279819ybi.45.1551387099652; Thu, 28 Feb 2019 12:51:39 -0800 (PST) Path: csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!m21no75453qta.0!news-out.google.com!y15ni27qta.0!nntp.google.com!m21no75451qta.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Thu, 28 Feb 2019 12:51:39 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=50.78.95.177; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H NNTP-Posting-Host: 50.78.95.177 References: <709a1f3b-fc99-4bd0-a8b8-866092bb7ae9@googlegroups.com> <8e1597a2-5c18-4fd1-83a4-7667e4d11e77@googlegroups.com> <23a8128b-5c54-45ba-bfd0-2f7dda078517@googlegroups.com> <692da128-9302-41cf-a8f7-2a2a5903bf82@googlegroups.com> <3a4ed199-10a5-4ea3-882e-8d598a82dccf@googlegroups.com> <6f5e7b36-af8f-4f1b-b7fe-f53305b8d591@googlegroups.com> <263782da-7ef6-466c-8cb3-da394bef0501@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: it's Closeable, but I don't want to close() it yet. From: Eric Douglas Injection-Date: Thu, 28 Feb 2019 20:51:39 +0000 Content-Type: text/plain; charset="UTF-8" Lines: 15 Xref: csiph.com comp.lang.java.programmer:38762 On Thursday, February 28, 2019 at 2:41:22 PM UTC-5, burs...@gmail.com wrote: > Mostlikely ResultSet is anyway auto closing in the > sense that when you have reached the last row, > it will anyway close. Not sure about that. > > But it should be automatically closed when you read > the next page via the same prepared statement, > since the documentation says: > > "A ResultSet object is automatically closed when > the Statement object that generated it is closed, > re-executed, or used to retrieve the next result > from a sequence of multiple results." > https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html > I see some old stackoverflow threads that say if you don't explicitly close the ResultSet and keep creating new ones it had a problem with a "too many open cursors" error. Is that still true?