Hey all,

I have just noticed odd behaviour with prepared statements in JDK1.2.

I have a preparedStatement which I create at the beginning of a function.
However if I substitue the place holders for values, within a loop, I get
the following error on second iteration:

java.sql.SQLException: Invalid state for getResultSet

However if I reinitialise the statement within the loop, that is, create a
new object for each iteration, it works fine.

Surely any new parameter values should clear the previous value, shouldn't
it?

Secondly, the function containing the above code is refusing to throw the
error back to the calling function.  It contains a try/finally block.

Shah.

p.s. This code works fine with 1.1

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to