Title: RE: Closing ResultSet and Statement?

You close the statement Object by calling .close() on it.

===
Gary Grewal


-----Original Message-----
From: Dianne Cree [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 4:33 PM
To: [EMAIL PROTECTED]
Subject: RE: Closing ResultSet and Statement?


sorry, rs.close is asp.  the correct java code came a few mails ago

-----Original Message-----
From: Dianne Cree [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 2:25 PM
To: [EMAIL PROTECTED]
Subject: RE: Closing ResultSet and Statement?


rs.close, isn't it?

-----Original Message-----
From: Mick Sullivan [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 12:49 PM
To: [EMAIL PROTECTED]
Subject: Closing ResultSet and Statement?


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.


Reply via email to