There's a public attribute on cursor called 'updatecount' which you can
use to determine how many rows where affected for insert/update/delete
calls. It uses the underlying statement's getUpdateCount()
Count()]. Watch out for some drivers (such as MySQL) which behave
differently than might be expected, for example MySQL will only give the
number of rows deleted if there is a where clause, otherwise it's
In Jython 2.2 'updatecount' will be deprecated in favor of using
'rowcount' for both select and for insert/update/delete as per the spec
Let me know if you have any problems/comments.
> -----Original Message-----
> From: jython-users-admin@...
> [mailto:jython-users-admin@...] On Behalf
> Of Alex_Kotchnev@...
> Sent: Friday, August 02, 2002 8:01 PM
> To: jython-users@...
> Subject: [Jython-users] Verifying update with zxJDBC
> Importance: High
> I was wondering if there is a neat way to confirm that an
> update query ran successfully with zxJDBC. I mean that
> normally the dbcursor.execute() method returns None if is
> successful. So, if I am updating 0, 1 or more rows in the
> database, I don't have any way to know.
> E.g. if I run a select query on , I can check the number of
> rows that I get, but how about update queries ?
> Alex Kotchnev
> Diversified Information Technologies
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> Jython-users mailing list