Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #267

Re: Close resultset but n

From joeNOSPAM@BEA.com.remove-dii-this
Subject Re: Close resultset but n
Message-ID <61657612-9987-4590-abbc-fa527a17b373@t65g2000hsf.googlegroups.com> (permalink)
Newsgroups comp.lang.java.databases
References <csGdneArQLxML3_VnZ2dnUVZ_sWdnZ2d@comcast.co
Date 2011-04-27 15:22 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases
On Sep 30, 4:14=A0pm, Lew <no...@lewscanon.com> wrote:
> "polilop" wrote:
> >> After i [sic] collect the rs i [sic] close it, but how do i [sic] clos=
e the connection?
> joeNOS...@BEA.com wrote:
> > The code isn't so good, that you obtain a connection and don't
> > retain/manage it. That being said, you can do this in the code
> > that is closing the result set, instead of closing the result set:
>
> > rs.getStatement().getConnection().close();
>
> > By spec, closing the connection will close the statement which
> > will close the result set.
>
> Alternatively, use a disconnected RowSet. =A0Then you can close the conne=
ction
> in the normal place, in the context of the code that opened it, and not w=
orry.
>
> --
> Lew

What Lew said. ;)

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.databases | Previous | Next | Find similar


Thread

Re: Close resultset but n joeNOSPAM@BEA.com.remove-dii-this - 2011-04-27 15:22 +0000

csiph-web