Bug #2500 | Statement.execute() returns true though ResultSet is empty | ||
---|---|---|---|
Submitted: | 24 Jan 2004 12:12 | Modified: | 20 Dec 2004 23:57 |
Reporter: | Jens Bradt | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 4.1.1 (MySQL), 3.0.10 (MySQL Connector/J | OS: | Windows (Windows ME) |
Assigned to: | CPU Architecture: | Any |
[24 Jan 2004 12:12]
Jens Bradt
[24 Jan 2004 14:09]
Mark Matthews
My API docs state that it returns false when there are no results, however I will need to check with JDBC spec lead, because I interpret this to mean that not even an empty result set was returned (i.e. the result of executing a stored function). If it is interpreted as 'empty results', this interpretation would be conter to the ability to determine the metadata of even an empty result set, which would not make sense given how the rest of the JDBC API works. This is especially considering the multitude of other places where the determination of empty result sets is demonstrated via using ResultSet.next() in the JDBC API docs. I see the behavior of the older versions of the driver as a bug, and not JDBC-compliant.
[7 Oct 2008 19:09]
pranaykumar kondekar
for select statement you should use statement.executeQuery("Select * from....") statement.execute is used for insert update delete