tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikola Milutinovic" <Nikola.Milutino...@ev.co.yu>
Subject Re: [OFF-TOPIC] RE: can resultset object be re-used
Date Wed, 01 Oct 2003 15:06:24 GMT
> Well I just gotta say that's not true.  You *can* re-use a resultset
> object.
>
> ResultSet rs = st.executeQuery("SELECT * FROM FOO");
> //code that loops over rs and outputs results...
> rs = st.executeQuery("SELECT * FROM BAR");
> //a re-used ResultSet object.

You're not re-using anything here, pal!

"Statement.executeQuery( String query )" *creates* a ResultSet object. What
you've done is create TWO ResultSet object. The first will be "lost" and
caught by the garbage collector (in C++ this would cause memory leak).

Nix.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message