Whether or not the connection is closed is irrelevant. Once you
free/release the connection back to the pool, you have to get another
one. However, I think that your pstmt object will still be usable. If
not, make another one just like your previous one (same parameters,
etc.) and you should get the same effect (increased performance for
numerous hits).
>
> > hi all!
> > is there anyone who can quickly answer the following question for
> me
> > (otherwise I will have to dig into JDBC implementation
> details...)
> > in one of my servlets I would like to keep PreparedStatement
> objects over
> > numerous calls to the same pages and just update the parameters
> every time.
> > e.g.
> > Connection con = ... //obtain connection, perhaps from
> connection pool
> > PreparedStatement pstmt = con.prepareStatement("SELECT * FROM
> any WHERE
> > some=?");
> > I keep the reference pstmt (e.g. inside the session object) for
> later use.
> > the connection, on the other hand, is released again (because it
> came from a
> > connection pool or the like, not closed!)
> > now my question is:
> > when I call something like
> > pstmt.setInt(1,10);
> > ResultSet rs = pstmt.executeQuery();
> > later, is it of any relevance if the connection-object that was
> used for the
> > creation of the PreparedStatement is back in the pool, or even
> used by
> > someone else in the meantime?
> > thanx & greetings to all
> >
> > --
> > GMX - Die Kommunikationsplattform im Internet.
> > http://www.gmx.net
> >
> > To change your membership options, refer to:
> > http://www.sys-con.com/java/list.cfm
>
>
> To change your membership options, refer to:
> http://www.sys-con.com/java/list.cfm
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm