You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org> on 2006/09/18 17:27:23 UTC

[jira] Commented: (DERBY-1314) Differences between client and embedded when invoking stored procedures using Statement.executeUpdate()

    [ http://issues.apache.org/jira/browse/DERBY-1314?page=comments#action_12435498 ] 
            
Knut Anders Hatlen commented on DERBY-1314:
-------------------------------------------

PROBLEM

The behaviour of executeQuery() and executeUpdate() did not match the
JDBC specification when invoking stored procedures.

SYMPTOMS

(1) When invoking a stored procedure with executeQuery() or
    executeUpdate(), an exception was thrown indicating that the
    procedure did not return the correct number of ResultSet objects,
    although the correct number of ResultSet objects was in fact
    returned.

(2) When invoking a stored procedure with executeQuery() or
    executeUpdate(), and the procedure did not return the correct
    number of ResultSet objects, the query executed successfully.

(3) With the network client driver, when invoking a stored procedure
    with executeUpdate(), the return value was -1, whereas the JDBC
    specification says it should be 0.

CAUSE

The methods executeQuery() and executeUpdate() were not implemented in
compliance with the JDBC specification.

SOLUTION

In Derby 10.2, the behaviour of the methods executeQuery() and
executeUpdate() has been changed to match the JDBC specification.

WORKAROUND

Use execute() instead of executeUpdate()/executeQuery() to invoke a
stored procedure which does not return exactly 0 or 1 ResultSet
objects.

> Differences between client and embedded when invoking stored procedures using Statement.executeUpdate()
> -------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1314
>                 URL: http://issues.apache.org/jira/browse/DERBY-1314
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.2.1.0
>            Reporter: Knut Anders Hatlen
>         Assigned To: Knut Anders Hatlen
>             Fix For: 10.2.1.0
>
>         Attachments: derby-1314-v1.diff, derby-1314-v1.stat
>
>
> When invoking a stored procedure using Statement.executeUpdate(), the
> client driver and the embedded driver behave differently.
> If the stored procedure does not return any result set, the embedded
> driver returns 0, whereas the client returns -1.
> If the stored procedure returns one or more result sets, the embedded
> driver returns -1, whereas the client fails with an exception.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira