db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <de...@segel.com>
Subject RE: Why close ResultSet & PreparedStatement?
Date Sat, 29 Nov 2008 22:34:39 GMT

> Amir Michail wrote:
> > Hi,
> >
> > Is there any point in calling the close method on ResultSet and the
> > close method of PreparedStatement?
> >
> > Amir
> >
> >
> You might later change the database to one where it matters much more.
> 
> Mark Thornton

Huh?

I'm sorry but your answer doesn't make any sense.

To answer Amir's question... you close the ResultSet and the
PreparedStatements to remove any overhead as a result of their
instantiation.

Actually its pretty rare that you want to close the prepared statement since
one would use a prepared statement for the life of the application/service.
(The point of a prepared statement is that you use the statement once and
you use it over and over ...)

Not sure what Mark means by "changes to the database".

HTH

-Mike




Mime
View raw message