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

Reply via email to