I'm not sure, but I think that you don't close a ResultSet, you only close 
the connection, in fact, you can even close the connection and still work 
with your ResultSet.
        Think of ResultSet like a normal class with an interator that allows you to 
go forward and backward.

sincerely,

Zenon Farias Braga F.


>From: "Mick Sullivan" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Closing ResultSet and Statement?
>Date: Mon, 19 Mar 2001 20:48:31 -0000
>
>Hi
>Does anyone know how to close a ResultSet?
>Heres my code:
>public String getName() throws Exception {
>               Statement statement = connection.createStatement();
>               int myInt = 1;
>               ResultSet rs = statement.executeQuery("SELECT Name"+
>               " FROM nameAddress" +
>               " WHERE ID = ("+
>               myInt + ")");
>                       rs.next();
>                       String myString = rs.getString("Name");
>                 //change the resultSet to a string
>                 //so it can be used by the jsp page
>               return myString;
>      }
>Any help at all would be much appreciated
>Thanks in advance,
>Mick
>
>
>
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply via email to