Index: java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java (revision 413872)
+++ java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java (working copy)
@@ -102,7 +102,7 @@
* Tests that Statement.executeUpdate() succeeds when
* no result sets are returned.
*
- *
Currently, this test fails with the client driver and JCC. + *
Currently, this test fails with JCC.
*
* @exception SQLException if a database error occurs
*/
@@ -194,7 +194,7 @@
* Tests that PreparedStatement.executeUpdate()
* succeeds when no result sets are returned.
*
- *
Currently, this test fails with the client driver and JCC. + *
Currently, this test fails with JCC.
*
* @exception SQLException if a database error occurs
*/
@@ -213,7 +213,7 @@
* Tests that PreparedStatement.executeUpdate() fails
* when a result set is returned from a stored procedure.
*
- *
Currently, this test fails with the client driver and + *
Currently, this test fails with
* JCC. However, the corresponding tests for
* Statement and CallableStatement
* succeed. Strange...
@@ -296,7 +296,7 @@
* Tests that CallableStatement.executeUpdate()
* succeeds when no result sets are returned.
*
- *
Currently, this test fails with the client driver and JCC. + *
Currently, this test fails with JCC. * * @exception SQLException if a database error occurs */ @@ -579,7 +579,7 @@ */ public static Test suite() { TestSuite suite = new TestSuite(ProcedureTest.class); - if (usingEmbedded()) { + if (!usingDerbyNet()) { suite.addTest (new ProcedureTest ("xtestExecuteUpdateWithNoDynamicResultSets")); @@ -592,6 +592,8 @@ suite.addTest (new ProcedureTest ("xtestExecuteUpdateWithNoDynamicResultSets_callable")); + } + if (usingEmbedded()) { suite.addTest (new ProcedureTest ("xtestRollbackStoredProcWhenExecuteQueryReturnsNothing")); Index: java/client/org/apache/derby/client/am/Statement.java =================================================================== --- java/client/org/apache/derby/client/am/Statement.java (revision 413872) +++ java/client/org/apache/derby/client/am/Statement.java (working copy) @@ -2093,6 +2093,12 @@ connection_.flowAutoCommit(); } } + + // The JDBC spec says that executeUpdate() should return 0 + // when no row count is returned. + if (executeType == executeUpdateMethod__ && updateCount_ < 0) { + updateCount_ = 0; + } } void flowExecuteBatch(int[] updateCounts) throws SqlException, BatchUpdateException { Index: java/client/org/apache/derby/client/am/PreparedStatement.java =================================================================== --- java/client/org/apache/derby/client/am/PreparedStatement.java (revision 413872) +++ java/client/org/apache/derby/client/am/PreparedStatement.java (working copy) @@ -386,13 +386,9 @@ } } - // also used by Blob - int executeUpdateX() throws SqlException { + private int executeUpdateX() throws SqlException { flowExecute(executeUpdateMethod__); - - if (sqlMode_ == isUpdate__) { - super.checkExecuteUpdatePostConditions("java.sql.PreparedStatement"); - } + checkExecuteUpdatePostConditions("java.sql.PreparedStatement"); return updateCount_; } @@ -1786,6 +1782,12 @@ } } + // The JDBC spec says that executeUpdate() should return 0 + // when no row count is returned. + if (executeType == executeUpdateMethod__ && updateCount_ < 0) { + updateCount_ = 0; + } + // Throw an exception if holdability returned by the server is different from requested. if (resultSet_ != null && resultSet_.resultSetHoldability_ != resultSetHoldability_ && sqlMode_ != isCall__) { throw new SqlException(agent_.logWriter_,