db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: CurrentOfTest.java in the client/server mode
Date Fri, 09 Feb 2007 09:12:01 GMT
Manjula Kutty <manjula.kutty@gmail.com> writes:

> Thanks Knut for your clarification. Please bear in mind that I don't know
> much about cursor states. But my strong feeling is that it should behave
> similar in both embedded and n/w server, other than the difference in the
> SQL states. But please find the attached test (which is a miniature of the
> CurrentOfTest.java), where I expect that cursor.getCursorName() should
> return null. And it works as expected in the embedded mode. But in N/w
> server it has a cursor name. Is that the correct behaviour?? If so please
> give me some more inputs..

I'm not sure what's the correct behaviour for getCursorName(). The
JDBC spec is vague on this issue, but the JDBC API Tutorial and
Reference, Third Edition says that it should return "the SQL name of
the cursor associated with this ResultSet object; null if this
ResultSet object is read-only and its cursor name has not been
specified with the Statement.setCursorName method". It also says that
"[if] a DBMS supports positioned update/delete, and if the method
Statement.setCursorName has not been called to specify a cursor name,
the JDBC driver or the underlying DBMS must generate a cursor name
when a SELECT ... FOR UPDATE" statement is executed."

So, according to the tutorial, the embedded driver behaves correctly,
whereas the network client doesn't.

Knut Anders

View raw message