It says in section 15.2.2 of the document says:
"next() — moves the cursor forward one row. Returns true if the cursor
is now
positioned on a row and false if the cursor is positioned after the last
row."
I guess the way to reconcile both this statement and the item in section
9.1 is for the next method to return false when closed. This is a novel
approach but I think it would require changes in both embedded and
client. It also would not necessarily fix the the SQuirreL issue I've
alluded to before so other method would need to be investigated as well.
I will investigate StmtCloseFunTest.java further.
Philip
Dan Debrunner wrote:
Philip Wilder wrote:
In regards to your last challenge, I am inclined to agree with your
position. If we consistently follow the specs over the javadocs that is
one less point for confusion. However as Kathey points out, this may
mean that there are "bugs" in the javadocs. If we adopt this philosophy
then we can simplify the advanced cases I specified in my auto-commit
document. One item I would really like to see in the JDBC 4.0 spec is
changing this item found in section 9.1 (in relation to closing
ResultSets):
"if the cursor is forward only, then when invocation of its next method
returns false"
to this
"if the cursor is forward only, then when invocation of its next method
returns false. Further calls to next method on this ResultSet will throw
an Exception."
if this is what is truly meant. If this is the case then Embedded is not
functioning to spec and Client (at least in part) is doing what it is
suppose to (from this it follows that SQuirreL is also not following the
spec). If not, the reverse is true.
I don't think the JDBC spec (4.0 section 9.1, or 3.0 section 10.1) needs
to be changed as you describe. The comment "if the cursor is forward
only, then when invocation of its next method returns false" is
describing when a ResultSet is closed.
The question then becomes what should the behaviour of a ResultSet be if
it is closed? For Statement and Connection objects is it required that
most methods throw exceptions if they are closed. I'm not sure where
this is defined, but I know Cloudscape followed it once we started
running the JDBC portion of the J2EE TCK. See StmtCloseFunTest.java
Dan.