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


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

Close resultset but not t

From "polilop" <polilop@THRWHITE.remove-dii-this>
Subject Close resultset but not t
Message-ID <gbtr3j$lbj$1@ss408.t-com.hr> (permalink)
Newsgroups comp.lang.java.databases
Date 2011-04-27 15:22 +0000
Organization TDS.net

Show all headers | 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 | NextNext in thread | Find similar


Thread

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