Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.databases > #265
| From | "Lew" <lew@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: Close resultset but n |
| Message-ID | <csGdneArQLxML3_VnZ2dnUVZ_sWdnZ2d@comcast.com> (permalink) |
| Newsgroups | comp.lang.java.databases |
| References | <90816268-847f-4656-9d2f-6ac3b2af1533@x35g2000hsb.googlegroups.co |
| Date | 2011-04-27 15:22 +0000 |
| Organization | TDS.net |
To: comp.lang.java.databases "polilop" wrote: >> After i [sic] collect the rs i [sic] close it, but how do i [sic] close the connection? joeNOSPAM@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. Then you can close the connection in the normal place, in the context of the code that opened it, and not worry. -- Lew --- * 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
Re: Close resultset but n "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:22 +0000
csiph-web