db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [jira] Commented: (DERBY-105) drop table statement shows wrong message after dropping table
Date Mon, 10 Jan 2005 20:51:55 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

RPost wrote:

> Won't that also display the message "Statement executed" for an
> insert/update/delete that affects 0 rows? That would mean that, for
example,
> an insert affecting 0 rows would not tell the user that 0 rows were
affected
> but only that the statement executed. Since inserts (et al) are much more
> frequent than create/drop statements the cure may be worse than the
disease.
>
> I don't know if there is a way to tell what type of statement
> (insert/update/delete/create/drop/other?) was being executed.

There is (or maybe, might be), a statement execution can return either
an update count, a ResultSet or 'no result'. I think DDL should return
'no result' and my guess is there are really one or two bugs ...

1) Derby does not correctly return 'no result' for DDL.

and/or

2) ij does not look handle 'no result' from a Statement execution.


The issue is for a simple execution that does not return multiple
results, ie not a procedure call, what is the correct way of detecting
the 'no result' state?


java.sql.Statement.executeUpdate(String sql) will return 0 (as
documented in the javadoc), but what call(s) needs to be made after that
to determine the difference between '0 update count' and 'no result'?

(and similar for Statement.execute() and PreparedStatement execute calls)

Dan.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFB4urqIv0S4qsbfuQRAoDkAJ9IllJmirkeEMuny/qLxZDIwEWiKgCgiJsh
bpdroTugYaMuzPHRhDxcXg4=
=0Y0b
-----END PGP SIGNATURE-----


Mime
View raw message