Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.databases > #263
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail |
|---|---|
| From | "polilop" <polilop@THRWHITE.remove-dii-this> |
| Subject | Close resultset but not t |
| Message-ID | <gbtr3j$lbj$1@ss408.t-com.hr> (permalink) |
| X-Comment-To | comp.lang.java.databases |
| Newsgroups | comp.lang.java.databases |
| Content-Type | text/plain; charset=IBM437 |
| Content-Transfer-Encoding | 8bit |
| X-Gateway | time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] |
| Lines | 34 |
| Date | Wed, 27 Apr 2011 15:22:43 GMT |
| NNTP-Posting-Host | 96.60.20.240 |
| X-Complaints-To | news@tds.net |
| X-Trace | newsreading01.news.tds.net 1303917763 96.60.20.240 (Wed, 27 Apr 2011 10:22:43 CDT) |
| NNTP-Posting-Date | Wed, 27 Apr 2011 10:22:43 CDT |
| Organization | TDS.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.databases:263 |
Show key headers only | View raw
To: comp.lang.java.databases
I have a method that has a resultset as return value, so i can not close the
connection:
public ResultSet getSomething()
{
StringBuffer sql = new StringBuffer();
Statement stmt = null;
try {
con = SQLTestFactory.createConnection();
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
sql.append("SELECT Someone from Something ");
rs = stmt.executeQuery(sql.toString());
return rs;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return rs;
}
}
After i collect the rs i close it, but how do i close the connection?
---
* 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 — Next in thread | Find similar
Close resultset but not t "polilop" <polilop@THRWHITE.remove-dii-this> - 2011-04-27 15:22 +0000 Re: Close resultset but n joeNOSPAM@BEA.com.remove-dii-this - 2011-04-27 15:22 +0000
csiph-web